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.     #[ORM\ManyToOne]
  28.     private ?Client $client null;
  29.     public function __construct()
  30.     {
  31.         $this->createdAt = new \DateTime();
  32.         $this->dimensions = new ArrayCollection();
  33.         $this->employees = new ArrayCollection();
  34.         $this->sessions = new ArrayCollection();
  35.     }
  36.     public function getId(): ?\Ramsey\Uuid\UuidInterface
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getCreatedAt(): ?\DateTimeInterface
  41.     {
  42.         return $this->createdAt;
  43.     }
  44.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  45.     {
  46.         $this->createdAt $createdAt;
  47.         return $this;
  48.     }
  49.     public function getName(): ?string
  50.     {
  51.         return $this->name;
  52.     }
  53.     public function setName(string $name): static
  54.     {
  55.         $this->name $name;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, Dimension>
  60.      */
  61.     public function getDimensions(): Collection
  62.     {
  63.         return $this->dimensions;
  64.     }
  65.     public function addDimension(Dimension $dimension): static
  66.     {
  67.         if (!$this->dimensions->contains($dimension)) {
  68.             $this->dimensions->add($dimension);
  69.             $dimension->setReviewForm($this);
  70.         }
  71.         return $this;
  72.     }
  73.     public function removeDimension(Dimension $dimension): static
  74.     {
  75.         if ($this->dimensions->removeElement($dimension)) {
  76.             // set the owning side to null (unless already changed)
  77.             if ($dimension->getReviewForm() === $this) {
  78.                 $dimension->setReviewForm(null);
  79.             }
  80.         }
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Employee>
  85.      */
  86.     public function getEmployees(): Collection
  87.     {
  88.         return $this->employees;
  89.     }
  90.     public function addEmployee(Employee $employee): static
  91.     {
  92.         if (!$this->employees->contains($employee)) {
  93.             $this->employees->add($employee);
  94.             $employee->setReviewForm($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeEmployee(Employee $employee): static
  99.     {
  100.         if ($this->employees->removeElement($employee)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($employee->getReviewForm() === $this) {
  103.                 $employee->setReviewForm(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, Session>
  110.      */
  111.     public function getSessions(): Collection
  112.     {
  113.         return $this->sessions;
  114.     }
  115.     public function addSession(Session $session): static
  116.     {
  117.         if (!$this->sessions->contains($session)) {
  118.             $this->sessions->add($session);
  119.             $session->setReviewForm($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeSession(Session $session): static
  124.     {
  125.         if ($this->sessions->removeElement($session)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($session->getReviewForm() === $this) {
  128.                 $session->setReviewForm(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133.     public function getClient(): ?client
  134.     {
  135.         return $this->client;
  136.     }
  137.     public function setClient(?client $client): static
  138.     {
  139.         $this->client $client;
  140.         return $this;
  141.     }
  142. }