vendor/croisiland/common-bundle/src/Entity/Correspondence/DestinationCorrespondence.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Croisiland\CommonBundle\Entity\Correspondence;
  4. use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
  5. use Croisiland\CommonBundle\Annotation\Correspondence\DestinationCorrespondenceFormValidator;
  6. use Croisiland\CommonBundle\Entity\Company\Company;
  7. use Croisiland\CommonBundle\Entity\Itinerary\DestinationMain;
  8. use Croisiland\CommonBundle\Entity\Itinerary\DestinationSecondary;
  9. use Croisiland\CommonBundle\Repository\Correspondence\DestinationCorrespondenceRepository;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12. * @DestinationCorrespondenceFormValidator(groups="destination_correspondence_form_validator")
  13. *
  14. * @ORM\Entity(repositoryClass=DestinationCorrespondenceRepository::class)
  15. */
  16. class DestinationCorrespondence
  17. {
  18. // TODO Add relations
  19. // * @var Compagny
  20. use LifecycleUserIdentifierTrait;
  21. /**
  22. * @ORM\Id
  23. *
  24. * @ORM\GeneratedValue
  25. *
  26. * @ORM\Column(type="integer")
  27. */
  28. private ?int $id = null;
  29. /**
  30. * @ORM\Column(type="string", length=255)
  31. */
  32. private string $name;
  33. /**
  34. * @ORM\Column(type="string", length=255)
  35. */
  36. private string $code;
  37. /**
  38. * @ORM\ManyToOne(targetEntity=DestinationMain::class, inversedBy="destinationCorrespondences")
  39. */
  40. private ?DestinationMain $destination = null;
  41. /**
  42. * @ORM\ManyToOne(targetEntity=DestinationSecondary::class, inversedBy="destinationCorrespondences")
  43. */
  44. private ?DestinationSecondary $destinationSecondary = null;
  45. /**
  46. * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="originatedCorrespondencesDestinations")
  47. *
  48. * @ORM\JoinColumn(nullable=false)
  49. */
  50. private ?Company $originCompany;
  51. public function getId(): ?int
  52. {
  53. return $this->id;
  54. }
  55. public function getName(): ?string
  56. {
  57. return $this->name;
  58. }
  59. public function setName(string $name): self
  60. {
  61. $this->name = $name;
  62. return $this;
  63. }
  64. public function getCode(): ?string
  65. {
  66. return $this->code;
  67. }
  68. public function setCode(string $code): self
  69. {
  70. $this->code = $code;
  71. return $this;
  72. }
  73. public function getDestination(): ?DestinationMain
  74. {
  75. return $this->destination;
  76. }
  77. public function setDestination(?DestinationMain $destination): self
  78. {
  79. $this->destination = $destination;
  80. return $this;
  81. }
  82. public function getDestinationSecondary(): ?DestinationSecondary
  83. {
  84. return $this->destinationSecondary;
  85. }
  86. public function setDestinationSecondary(?DestinationSecondary $destinationSecondary): self
  87. {
  88. $this->destinationSecondary = $destinationSecondary;
  89. return $this;
  90. }
  91. public function getOriginCompany(): ?Company
  92. {
  93. return $this->originCompany;
  94. }
  95. public function setOriginCompany(?Company $originCompany): self
  96. {
  97. $this->originCompany = $originCompany;
  98. return $this;
  99. }
  100. }