src/Entity/Groupe.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GroupeRepository;
  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 Gedmo\Mapping\Annotation as Gedmo;
  9. #[ORM\Entity(repositoryClassGroupeRepository::class)]
  10. #[ORM\Table(name"groupes")]
  11. class Groupe
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[ORM\Column(type'string'nullabletruelength255)]
  18.     private $code;
  19.     #[ORM\Column(type'text')]
  20.     private $nom;
  21.     #[ORM\ManyToMany(targetEntityPtf::class, mappedBy'groupe')]
  22.     private $ptfs;
  23.     #[ORM\Column(type'text'nullabletrue)]
  24.     private $description;
  25.     #[Gedmo\Timestampable(on'create')]
  26.     #[ORM\Column(type'datetime')]
  27.     private $created_at;
  28.     #[Gedmo\Timestampable(on'update')]
  29.     #[ORM\Column(type'datetime')]
  30.     private $updated_at;
  31.     #[ORM\Column(type'integer')]
  32.     private $created_by;
  33.     #[ORM\Column(type'integer')]
  34.     private $updated_by;
  35.     #[ORM\Column(type'string'length255nullabletrue)]
  36.     private $file;
  37.     #[ORM\OneToMany(mappedBy'groupe'targetEntityStructureAssocie::class)]
  38.     private $structureAssocies;
  39.     #[ORM\ManyToMany(targetEntityDomaine::class, inversedBy'groupes')]
  40.     private $domaine;
  41.     #[ORM\ManyToOne(targetEntityPtf::class)]
  42.     private $chef;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $slide null;
  45.     #[ORM\OneToMany(mappedBy'groupe'targetEntityDocument::class)]
  46.     private Collection $documents;
  47.     #[ORM\OneToMany(mappedBy'groupe'targetEntityEvenement::class)]
  48.     private Collection $evenements;
  49.     #[ORM\Column(typeTypes::TEXT)]
  50.     private ?string $resume null;
  51.     #[ORM\ManyToOne(inversedBy'groupes')]
  52.     private ?User $user null;
  53.     public function __construct()
  54.     {
  55.         $this->ptfs = new ArrayCollection();
  56.         $this->structureAssocies = new ArrayCollection();
  57.         $this->domaine = new ArrayCollection();
  58.         $this->documents = new ArrayCollection();
  59.         $this->evenements = new ArrayCollection();
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getCode(): ?string
  66.     {
  67.         return $this->code;
  68.     }
  69.     public function setCode(string $code): self
  70.     {
  71.         $this->code $code;
  72.         return $this;
  73.     }
  74.     public function getNom(): ?string
  75.     {
  76.         return $this->nom;
  77.     }
  78.     public function setNom(string $nom): self
  79.     {
  80.         $this->nom $nom;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Ptf>
  85.      */
  86.     public function getPtfs(): Collection
  87.     {
  88.         return $this->ptfs;
  89.     }
  90.     public function addPtf(Ptf $ptf): self
  91.     {
  92.         if (!$this->ptfs->contains($ptf)) {
  93.             $this->ptfs[] = $ptf;
  94.             $ptf->addGroupe($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removePtf(Ptf $ptf): self
  99.     {
  100.         if ($this->ptfs->removeElement($ptf)) {
  101.             $ptf->removeGroupe($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeAllPtf(): self
  106.     {
  107.         foreach ($this->ptfs as $ptf) {
  108.             $this->removePtf($ptf);
  109.         }
  110.         return $this;
  111.     }
  112.     public function getDescription(): ?string
  113.     {
  114.         return $this->description;
  115.     }
  116.     public function setDescription(?string $description): self
  117.     {
  118.         $this->description $description;
  119.         return $this;
  120.     }
  121.     public function getCreatedAt(): ?\DateTimeInterface
  122.     {
  123.         return $this->created_at;
  124.     }
  125.     public function setCreatedAt(\DateTimeInterface $created_at): self
  126.     {
  127.         $this->created_at $created_at;
  128.         return $this;
  129.     }
  130.     public function getUpdatedAt(): ?\DateTimeInterface
  131.     {
  132.         return $this->updated_at;
  133.     }
  134.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  135.     {
  136.         $this->updated_at $updated_at;
  137.         return $this;
  138.     }
  139.     public function getCreatedBy(): ?int
  140.     {
  141.         return $this->created_by;
  142.     }
  143.     public function setCreatedBy(int $created_by): self
  144.     {
  145.         $this->created_by $created_by;
  146.         return $this;
  147.     }
  148.     public function getUpdatedBy(): ?int
  149.     {
  150.         return $this->updated_by;
  151.     }
  152.     public function setUpdatedBy(int $updated_by): self
  153.     {
  154.         $this->updated_by $updated_by;
  155.         return $this;
  156.     }
  157.     public function getFile(): ?string
  158.     {
  159.         return $this->file;
  160.     }
  161.     public function setFile(?string $file): self
  162.     {
  163.         $this->file $file;
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Collection<int, StructureAssocie>
  168.      */
  169.     public function getStructureAssocies(): Collection
  170.     {
  171.         return $this->structureAssocies;
  172.     }
  173.     public function addStructureAssocy(StructureAssocie $structureAssocy): self
  174.     {
  175.         if (!$this->structureAssocies->contains($structureAssocy)) {
  176.             $this->structureAssocies[] = $structureAssocy;
  177.             $structureAssocy->setGroupe($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeStructureAssocy(StructureAssocie $structureAssocy): self
  182.     {
  183.         if ($this->structureAssocies->removeElement($structureAssocy)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($structureAssocy->getGroupe() === $this) {
  186.                 $structureAssocy->setGroupe(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return Collection<int, Domaine>
  193.      */
  194.     public function getDomaine(): Collection
  195.     {
  196.         return $this->domaine;
  197.     }
  198.     public function addDomaine(Domaine $domaine): self
  199.     {
  200.         if (!$this->domaine->contains($domaine)) {
  201.             $this->domaine[] = $domaine;
  202.         }
  203.         return $this;
  204.     }
  205.     public function removeDomaine(Domaine $domaine): self
  206.     {
  207.         $this->domaine->removeElement($domaine);
  208.         return $this;
  209.     }
  210.     public function removeAllDomaine(): self
  211.     {
  212.         foreach ($this->domaine as $d) {
  213.             $this->removeDomaine($d);
  214.         }
  215.         return $this;
  216.     }
  217.     public function getChef(): ?Ptf
  218.     {
  219.         return $this->chef;
  220.     }
  221.     public function setChef(?Ptf $chef): self
  222.     {
  223.         $this->chef $chef;
  224.         return $this;
  225.     }
  226.     public function getSlide(): ?string
  227.     {
  228.         return $this->slide;
  229.     }
  230.     public function setSlide(?string $slide): self
  231.     {
  232.         $this->slide $slide;
  233.         return $this;
  234.     }
  235.     /**
  236.      * @return Collection<int, Document>
  237.      */
  238.     public function getDocuments(): Collection
  239.     {
  240.         return $this->documents;
  241.     }
  242.     public function addDocument(Document $document): self
  243.     {
  244.         if (!$this->documents->contains($document)) {
  245.             $this->documents[] = $document;
  246.             $document->setGroupe($this);
  247.         }
  248.         return $this;
  249.     }
  250.     public function removeDocument(Document $document): self
  251.     {
  252.         if ($this->documents->removeElement($document)) {
  253.             // set the owning side to null (unless already changed)
  254.             if ($document->getGroupe() === $this) {
  255.                 $document->setGroupe(null);
  256.             }
  257.         }
  258.         return $this;
  259.     }
  260.     /**
  261.      * @return Collection<int, Evenement>
  262.      */
  263.     public function getEvenements(): Collection
  264.     {
  265.         return $this->evenements;
  266.     }
  267.     public function addEvenement(Evenement $evenement): self
  268.     {
  269.         if (!$this->evenements->contains($evenement)) {
  270.             $this->evenements->add($evenement);
  271.             $evenement->setGroupe($this);
  272.         }
  273.         return $this;
  274.     }
  275.     public function removeEvenement(Evenement $evenement): self
  276.     {
  277.         if ($this->evenements->removeElement($evenement)) {
  278.             // set the owning side to null (unless already changed)
  279.             if ($evenement->getGroupe() === $this) {
  280.                 $evenement->setGroupe(null);
  281.             }
  282.         }
  283.         return $this;
  284.     }
  285.     public function getResume(): ?string
  286.     {
  287.         return $this->resume;
  288.     }
  289.     public function setResume(string $resume): self
  290.     {
  291.         $this->resume $resume;
  292.         return $this;
  293.     }
  294.     public function getUser(): ?User
  295.     {
  296.         return $this->user;
  297.     }
  298.     public function setUser(?User $user): self
  299.     {
  300.         $this->user $user;
  301.         return $this;
  302.     }
  303. }