src/Entity/Project/Project.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Project;
  3. use App\Entity\Client\Client;
  4. use App\Entity\Request\RequestForm;
  5. use App\Entity\User\User;
  6. use App\Repository\Project\ProjectRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassProjectRepository::class)]
  11. class Project
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $name null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $codeMonday null;
  21.     #[ORM\ManyToOne(inversedBy'projects')]
  22.     private ?Client $client null;
  23.     #[ORM\ManyToOne(inversedBy'projects')]
  24.     private ?User $user null;
  25.     #[ORM\OneToMany(mappedBy'project'targetEntityRequestForm::class)]
  26.     private Collection $requestForms;
  27.     public function __construct()
  28.     {
  29.         $this->requestForms = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getCodeMonday(): ?string
  36.     {
  37.         return $this->codeMonday;
  38.     }
  39.     public function setCodeMonday(string $codeMonday): static
  40.     {
  41.         $this->codeMonday $codeMonday;
  42.         return $this;
  43.     }
  44.     public function getClient(): ?Client
  45.     {
  46.         return $this->client;
  47.     }
  48.     public function setClient(?Client $client): static
  49.     {
  50.         $this->client $client;
  51.         return $this;
  52.     }
  53.     public function getUser(): ?User
  54.     {
  55.         return $this->user;
  56.     }
  57.     public function setUser(?User $user): static
  58.     {
  59.         $this->user $user;
  60.         return $this;
  61.     }
  62.     public function getName(): ?string
  63.     {
  64.         return $this->name;
  65.     }
  66.     public function setName(string $name): static
  67.     {
  68.         $this->name $name;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, RequestForm>
  73.      */
  74.     public function getRequestForms(): Collection
  75.     {
  76.         return $this->requestForms;
  77.     }
  78.     public function addRequestForm(RequestForm $requestForm): static
  79.     {
  80.         if (!$this->requestForms->contains($requestForm)) {
  81.             $this->requestForms->add($requestForm);
  82.             $requestForm->setProject($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeRequestForm(RequestForm $requestForm): static
  87.     {
  88.         if ($this->requestForms->removeElement($requestForm)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($requestForm->getProject() === $this) {
  91.                 $requestForm->setProject(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96. }