src/Entity/ReservationLoungeWebDescription.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Constants\LanguageConstants;
  4. use App\MDS\VenuesBundle\Entity\ReservationLoungeDetails;
  5. use App\Repository\ReservationLoungeWebDescriptionRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClass: ReservationLoungeWebDescriptionRepository::class)]
  9. #[ORM\HasLifecycleCallbacks]
  10. class ReservationLoungeWebDescription
  11. {
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue]
  14. #[ORM\Column(type: 'integer')]
  15. private $id;
  16. #[ORM\ManyToOne(targetEntity: ReservationLoungeDetails::class, inversedBy: 'reservationLoungeWebDescriptions')]
  17. #[ORM\JoinColumn(nullable: false)]
  18. #[Groups(['reservation_lounge_web_description:read'])]
  19. private $lounge;
  20. #[ORM\Column(type: 'integer')]
  21. #[Groups(['reservation_lounge_web_description:read'])]
  22. private $language;
  23. #[ORM\Column(type: 'text', nullable: true)]
  24. #[Groups(['reservation_lounge_web_description:read'])]
  25. private $importantDescription;
  26. #[ORM\Column(type: 'text', nullable: true)]
  27. #[Groups(['reservation_lounge_web_description:read'])]
  28. private $importantDescGeneralText;
  29. #[ORM\Column(type: 'text', nullable: true)]
  30. #[Groups(['reservation_lounge_web_description:read'])]
  31. private $importantDescSchedules;
  32. #[ORM\Column(type: 'text', nullable: true)]
  33. #[Groups(['reservation_lounge_web_description:read'])]
  34. private $importantDescParking;
  35. #[ORM\Column(type: 'datetime_immutable')]
  36. private $createdAt;
  37. #[ORM\ManyToOne(targetEntity: User::class)]
  38. #[ORM\JoinColumn(nullable: false)]
  39. private $createdId;
  40. #[ORM\Column(type: 'datetime_immutable')]
  41. private $updatedAt;
  42. #[ORM\ManyToOne(targetEntity: User::class)]
  43. #[ORM\JoinColumn(nullable: false)]
  44. private $updatedId;
  45. public function getId(): ?int
  46. {
  47. return $this->id;
  48. }
  49. public function getLounge(): ?ReservationLoungeDetails
  50. {
  51. return $this->lounge;
  52. }
  53. public function setLounge(?ReservationLoungeDetails $lounge): self
  54. {
  55. $this->lounge = $lounge;
  56. return $this;
  57. }
  58. public function getLanguage(): ?int
  59. {
  60. return $this->language;
  61. }
  62. public function setLanguage(int $language): self
  63. {
  64. if(!in_array($language, LanguageConstants::getAvailableLanguages(), true)) {
  65. throw new \InvalidArgumentException('Invalid language provided.');
  66. }
  67. $this->language = $language;
  68. return $this;
  69. }
  70. public function getImportantDescription(): ?string
  71. {
  72. return $this->importantDescription;
  73. }
  74. public function setImportantDescription(?string $importantDescription): self
  75. {
  76. $this->importantDescription = $importantDescription;
  77. return $this;
  78. }
  79. public function getImportantDescGeneralText(): ?string
  80. {
  81. return $this->importantDescGeneralText;
  82. }
  83. public function setImportantDescGeneralText(?string $importantDescGeneralText): self
  84. {
  85. $this->importantDescGeneralText = $importantDescGeneralText;
  86. return $this;
  87. }
  88. public function getImportantDescSchedules(): ?string
  89. {
  90. return $this->importantDescSchedules;
  91. }
  92. public function setImportantDescSchedules(?string $importantDescSchedules): self
  93. {
  94. $this->importantDescSchedules = $importantDescSchedules;
  95. return $this;
  96. }
  97. public function getImportantDescParking(): ?string
  98. {
  99. return $this->importantDescParking;
  100. }
  101. public function setImportantDescParking(?string $importantDescParking): self
  102. {
  103. $this->importantDescParking = $importantDescParking;
  104. return $this;
  105. }
  106. public function getCreatedAt(): ?\DateTimeImmutable
  107. {
  108. return $this->createdAt;
  109. }
  110. public function setCreatedAt(\DateTimeImmutable $createdAt): self
  111. {
  112. $this->createdAt = $createdAt;
  113. return $this;
  114. }
  115. public function getCreatedId(): ?User
  116. {
  117. return $this->createdId;
  118. }
  119. public function setCreatedId(?User $createdId): self
  120. {
  121. $this->createdId = $createdId;
  122. return $this;
  123. }
  124. public function getUpdatedAt(): ?\DateTimeImmutable
  125. {
  126. return $this->updatedAt;
  127. }
  128. public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  129. {
  130. $this->updatedAt = $updatedAt;
  131. return $this;
  132. }
  133. public function getUpdatedId(): ?User
  134. {
  135. return $this->updatedId;
  136. }
  137. public function setUpdatedId(?User $updatedId): self
  138. {
  139. $this->updatedId = $updatedId;
  140. return $this;
  141. }
  142. #[ORM\PrePersist]
  143. public function onPrePersist()
  144. {
  145. $this->createdAt = new \DateTimeImmutable();
  146. $this->updatedAt = new \DateTimeImmutable();
  147. }
  148. #[ORM\PreUpdate]
  149. public function onPreUpdate()
  150. {
  151. $this->updatedAt = new \DateTimeImmutable();
  152. }
  153. }