<?phpnamespace App\Entity;use App\Constants\LanguageConstants;use App\MDS\GreenPatioBundle\Entity\ReservationLoungeDetails;use App\Repository\ReservationLoungeWebDescriptionRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;/** * @ORM\Entity(repositoryClass=ReservationLoungeWebDescriptionRepository::class) * @ORM\HasLifecycleCallbacks */class ReservationLoungeWebDescription{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=ReservationLoungeDetails::class, inversedBy="reservationLoungeWebDescriptions") * @ORM\JoinColumn(nullable=false) * @Groups({"reservation_lounge_web_description:read"}) */ private $lounge; /** * @ORM\Column(type="integer") * @Groups({"reservation_lounge_web_description:read"}) */ private $language; /** * @ORM\Column(type="text", nullable=true) * @Groups({"reservation_lounge_web_description:read"}) */ private $importantDescription; /** * @ORM\Column(type="text", nullable=true) * @Groups({"reservation_lounge_web_description:read"}) */ private $importantDescGeneralText; /** * @ORM\Column(type="text", nullable=true) * @Groups({"reservation_lounge_web_description:read"}) */ private $importantDescSchedules; /** * @ORM\Column(type="text", nullable=true) * @Groups({"reservation_lounge_web_description:read"}) */ private $importantDescParking; /** * @ORM\Column(type="datetime_immutable") */ private $createdAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) */ private $createdId; /** * @ORM\Column(type="datetime_immutable") */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) */ private $updatedId; public function getId(): ?int { return $this->id; } public function getLounge(): ?ReservationLoungeDetails { return $this->lounge; } public function setLounge(?ReservationLoungeDetails $lounge): self { $this->lounge = $lounge; return $this; } public function getLanguage(): ?int { return $this->language; } public function setLanguage(int $language): self { if(!in_array($language, LanguageConstants::getAvailableLanguages(), true)) { throw new \InvalidArgumentException('Invalid language provided.'); } $this->language = $language; return $this; } public function getImportantDescription(): ?string { return $this->importantDescription; } public function setImportantDescription(?string $importantDescription): self { $this->importantDescription = $importantDescription; return $this; } public function getImportantDescGeneralText(): ?string { return $this->importantDescGeneralText; } public function setImportantDescGeneralText(?string $importantDescGeneralText): self { $this->importantDescGeneralText = $importantDescGeneralText; return $this; } public function getImportantDescSchedules(): ?string { return $this->importantDescSchedules; } public function setImportantDescSchedules(?string $importantDescSchedules): self { $this->importantDescSchedules = $importantDescSchedules; return $this; } public function getImportantDescParking(): ?string { return $this->importantDescParking; } public function setImportantDescParking(?string $importantDescParking): self { $this->importantDescParking = $importantDescParking; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getCreatedId(): ?User { return $this->createdId; } public function setCreatedId(?User $createdId): self { $this->createdId = $createdId; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getUpdatedId(): ?User { return $this->updatedId; } public function setUpdatedId(?User $updatedId): self { $this->updatedId = $updatedId; return $this; } /** * @ORM\PrePersist */ public function onPrePersist() { $this->createdAt = new \DateTimeImmutable(); $this->updatedAt = new \DateTimeImmutable(); } /** * @ORM\PreUpdate */ public function onPreUpdate() { $this->updatedAt = new \DateTimeImmutable(); }}