src/Entity/ReviewForm.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReviewFormRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Ramsey\Uuid\Doctrine\UuidGenerator;
  9. #[ORM\Entity(repositoryClassReviewFormRepository::class)]
  10. class ReviewForm
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\Column(type'uuid'uniquetrue)]
  14.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  15.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  16.     private ?\Ramsey\Uuid\UuidInterface $id null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $createdAt null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $name null;
  21.     #[ORM\OneToMany(targetEntityDimension::class, mappedBy'reviewForm')]
  22.     private Collection $dimensions;
  23.     #[ORM\OneToMany(targetEntityEmployee::class, mappedBy'ReviewForm')]
  24.     private Collection $employees;
  25.     #[ORM\OneToMany(targetEntitySession::class, mappedBy'reviewForm')]
  26.     private Collection $sessions;
  27.     public function __construct()
  28.     {
  29.         $this->createdAt = new \DateTime();
  30.         $this->dimensions = new ArrayCollection();
  31.         $this->employees = new ArrayCollection();
  32.         $this->sessions = new ArrayCollection();
  33.     }
  34.     public function getId(): ?\Ramsey\Uuid\UuidInterface
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getCreatedAt(): ?\DateTimeInterface
  39.     {
  40.         return $this->createdAt;
  41.     }
  42.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  43.     {
  44.         $this->createdAt $createdAt;
  45.         return $this;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): static
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection<int, Dimension>
  58.      */
  59.     public function getDimensions(): Collection
  60.     {
  61.         return $this->dimensions;
  62.     }
  63.     public function addDimension(Dimension $dimension): static
  64.     {
  65.         if (!$this->dimensions->contains($dimension)) {
  66.             $this->dimensions->add($dimension);
  67.             $dimension->setReviewForm($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removeDimension(Dimension $dimension): static
  72.     {
  73.         if ($this->dimensions->removeElement($dimension)) {
  74.             // set the owning side to null (unless already changed)
  75.             if ($dimension->getReviewForm() === $this) {
  76.                 $dimension->setReviewForm(null);
  77.             }
  78.         }
  79.         return $this;
  80.     }
  81.     /**
  82.      * @return Collection<int, Employee>
  83.      */
  84.     public function getEmployees(): Collection
  85.     {
  86.         return $this->employees;
  87.     }
  88.     public function addEmployee(Employee $employee): static
  89.     {
  90.         if (!$this->employees->contains($employee)) {
  91.             $this->employees->add($employee);
  92.             $employee->setReviewForm($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeEmployee(Employee $employee): static
  97.     {
  98.         if ($this->employees->removeElement($employee)) {
  99.             // set the owning side to null (unless already changed)
  100.             if ($employee->getReviewForm() === $this) {
  101.                 $employee->setReviewForm(null);
  102.             }
  103.         }
  104.         return $this;
  105.     }
  106.     /**
  107.      * @return Collection<int, Session>
  108.      */
  109.     public function getSessions(): Collection
  110.     {
  111.         return $this->sessions;
  112.     }
  113.     public function addSession(Session $session): static
  114.     {
  115.         if (!$this->sessions->contains($session)) {
  116.             $this->sessions->add($session);
  117.             $session->setReviewForm($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeSession(Session $session): static
  122.     {
  123.         if ($this->sessions->removeElement($session)) {
  124.             // set the owning side to null (unless already changed)
  125.             if ($session->getReviewForm() === $this) {
  126.                 $session->setReviewForm(null);
  127.             }
  128.         }
  129.         return $this;
  130.     }
  131. }