src/Entity/ReservationLoungeWebDescription.php line 15

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