src/Entity/Project.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectRepository;
  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. #[ORM\Entity(repositoryClassProjectRepository::class)]
  9. class Project
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\ManyToOne(inversedBy'projects')]
  16.     private ?Contact $contact null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $label null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  20.     private ?\DateTimeInterface $date_creation null;
  21.     #[ORM\OneToMany(mappedBy'projet'targetEntityDocument::class, cascade: ['remove'])]
  22.     private Collection $documents;
  23.     #[ORM\OneToMany(mappedBy'projet'targetEntityImage::class, cascade: ['remove'])]
  24.     private Collection $images;
  25.     #[ORM\OneToMany(mappedBy'projet'targetEntityDossier::class, cascade: ['remove'])]
  26.     private Collection $dossiers;
  27.     #[ORM\OneToMany(mappedBy'project'targetEntityVariableValue::class)]
  28.     private Collection $variableValues;
  29.     #[ORM\ManyToOne(inversedBy'projects')]
  30.     private ?ProjectType $project_type null;
  31.     #[ORM\ManyToOne(inversedBy'projects')]
  32.     private ?User $utilisateur null;
  33.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  34.     private ?\DateTimeInterface $date_debut null;
  35.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  36.     private ?\DateTimeInterface $date_fin null;
  37.     #[ORM\OneToMany(mappedBy'projet'targetEntityFichier::class)]
  38.     private Collection $fichiers;
  39.     public function __construct()
  40.     {
  41.         $this->documents = new ArrayCollection();
  42.         $this->images = new ArrayCollection();
  43.         $this->dossiers = new ArrayCollection();
  44.         $this->variableValues = new ArrayCollection();
  45.         $this->fichiers = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getContact(): ?Contact
  52.     {
  53.         return $this->contact;
  54.     }
  55.     public function setContact(?Contact $contact): static
  56.     {
  57.         $this->contact $contact;
  58.         return $this;
  59.     }
  60.     public function getLabel(): ?string
  61.     {
  62.         return $this->label;
  63.     }
  64.     public function setLabel(string $label): static
  65.     {
  66.         $this->label $label;
  67.         return $this;
  68.     }
  69.     public function getDateCreation(): ?\DateTimeInterface
  70.     {
  71.         return $this->date_creation;
  72.     }
  73.     public function setDateCreation(\DateTimeInterface $date_creation): static
  74.     {
  75.         $this->date_creation $date_creation;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection<int, Document>
  80.      */
  81.     public function getDocuments(): Collection
  82.     {
  83.         return $this->documents;
  84.     }
  85.     public function addDocument(Document $document): static
  86.     {
  87.         if (!$this->documents->contains($document)) {
  88.             $this->documents->add($document);
  89.             $document->setProjet($this);
  90.         }
  91.         return $this;
  92.     }
  93.     public function removeDocument(Document $document): static
  94.     {
  95.         if ($this->documents->removeElement($document)) {
  96.             // set the owning side to null (unless already changed)
  97.             if ($document->getProjet() === $this) {
  98.                 $document->setProjet(null);
  99.             }
  100.         }
  101.         return $this;
  102.     }
  103.     /**
  104.      * @return Collection<int, Image>
  105.      */
  106.     public function getImages(): Collection
  107.     {
  108.         return $this->images;
  109.     }
  110.     public function addImage(Image $image): static
  111.     {
  112.         if (!$this->images->contains($image)) {
  113.             $this->images->add($image);
  114.             $image->setProjet($this);
  115.         }
  116.         return $this;
  117.     }
  118.     public function removeImage(Image $image): static
  119.     {
  120.         if ($this->images->removeElement($image)) {
  121.             // set the owning side to null (unless already changed)
  122.             if ($image->getProjet() === $this) {
  123.                 $image->setProjet(null);
  124.             }
  125.         }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, Dossier>
  130.      */
  131.     public function getDossiers(): Collection
  132.     {
  133.         return $this->dossiers;
  134.     }
  135.     public function addDossier(Dossier $dossier): static
  136.     {
  137.         if (!$this->dossiers->contains($dossier)) {
  138.             $this->dossiers->add($dossier);
  139.             $dossier->setProjet($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeDossier(Dossier $dossier): static
  144.     {
  145.         if ($this->dossiers->removeElement($dossier)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($dossier->getProjet() === $this) {
  148.                 $dossier->setProjet(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, VariableValue>
  155.      */
  156.     public function getVariableValues(): Collection
  157.     {
  158.         return $this->variableValues;
  159.     }
  160.     public function addVariableValue(VariableValue $variableValue): static
  161.     {
  162.         if (!$this->variableValues->contains($variableValue)) {
  163.             $this->variableValues->add($variableValue);
  164.             $variableValue->setProject($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeVariableValue(VariableValue $variableValue): static
  169.     {
  170.         if ($this->variableValues->removeElement($variableValue)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($variableValue->getProject() === $this) {
  173.                 $variableValue->setProject(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     public function getProjectType(): ?ProjectType
  179.     {
  180.         return $this->project_type;
  181.     }
  182.     public function setProjectType(?ProjectType $project_type): static
  183.     {
  184.         $this->project_type $project_type;
  185.         return $this;
  186.     }
  187.     public function getUtilisateur(): ?User
  188.     {
  189.         return $this->utilisateur;
  190.     }
  191.     public function setUtilisateur(?User $utilisateur): static
  192.     {
  193.         $this->utilisateur $utilisateur;
  194.         return $this;
  195.     }
  196.     public function getDateDebut(): ?\DateTimeInterface
  197.     {
  198.         return $this->date_debut;
  199.     }
  200.     public function setDateDebut(?\DateTimeInterface $date_debut): static
  201.     {
  202.         $this->date_debut $date_debut;
  203.         return $this;
  204.     }
  205.     public function getDateFin(): ?\DateTimeInterface
  206.     {
  207.         return $this->date_fin;
  208.     }
  209.     public function setDateFin(?\DateTimeInterface $date_fin): static
  210.     {
  211.         $this->date_fin $date_fin;
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return Collection<int, Fichier>
  216.      */
  217.     public function getFichiers(): Collection
  218.     {
  219.         return $this->fichiers;
  220.     }
  221.     public function addFichier(Fichier $fichier): static
  222.     {
  223.         if (!$this->fichiers->contains($fichier)) {
  224.             $this->fichiers->add($fichier);
  225.             $fichier->setProjet($this);
  226.         }
  227.         return $this;
  228.     }
  229.     public function removeFichier(Fichier $fichier): static
  230.     {
  231.         if ($this->fichiers->removeElement($fichier)) {
  232.             // set the owning side to null (unless already changed)
  233.             if ($fichier->getProjet() === $this) {
  234.                 $fichier->setProjet(null);
  235.             }
  236.         }
  237.         return $this;
  238.     }
  239. }