src/Entity/CentreFonction.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CentreFonctionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CentreFonctionRepository::class)
  9.  */
  10. class CentreFonction
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $fct_nom;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Droit::class, mappedBy="drt_fonction", cascade={"remove"})
  24.      */
  25.     private $droits;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=UtilisateurInfo::class, mappedBy="utl_inf_fonction", orphanRemoval=true)
  28.      */
  29.     private $utilisateurInfos;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=true)
  32.      */
  33.     private $id_old;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=CentreGroupe::class)
  36.      * @ORM\JoinColumn(nullable=false)
  37.      */
  38.     private $CentreGroupe;
  39.     public function __construct()
  40.     {
  41.         $this->droits = new ArrayCollection();
  42.         $this->utilisateurInfos = new ArrayCollection();
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getFctNom(): ?string
  49.     {
  50.         return $this->fct_nom;
  51.     }
  52.     public function setFctNom(string $fct_nom): self
  53.     {
  54.         $this->fct_nom $fct_nom;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Droit>
  59.      */
  60.     public function getDroits(): Collection
  61.     {
  62.         return $this->droits;
  63.     }
  64.     public function addDroit(Droit $droit): self
  65.     {
  66.         if (!$this->droits->contains($droit)) {
  67.             $this->droits[] = $droit;
  68.             $droit->setDrtFonction($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeDroit(Droit $droit): self
  73.     {
  74.         if ($this->droits->removeElement($droit)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($droit->getDrtFonction() === $this) {
  77.                 $droit->setDrtFonction(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, UtilisateurInfo>
  84.      */
  85.     public function getUtilisateurInfos(): Collection
  86.     {
  87.         return $this->utilisateurInfos;
  88.     }
  89.     public function addUtilisateurInfo(UtilisateurInfo $utilisateurInfo): self
  90.     {
  91.         if (!$this->utilisateurInfos->contains($utilisateurInfo)) {
  92.             $this->utilisateurInfos[] = $utilisateurInfo;
  93.             $utilisateurInfo->setUtlInfFonction($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeUtilisateurInfo(UtilisateurInfo $utilisateurInfo): self
  98.     {
  99.         if ($this->utilisateurInfos->removeElement($utilisateurInfo)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($utilisateurInfo->getUtlInfFonction() === $this) {
  102.                 $utilisateurInfo->setUtlInfFonction(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     public function getIdOld(): ?int
  108.     {
  109.         return $this->id_old;
  110.     }
  111.     public function setIdOld(int $id_old): self
  112.     {
  113.         $this->id_old $id_old;
  114.         return $this;
  115.     }
  116.     public function getCentreGroupe(): ?CentreGroupe
  117.     {
  118.         return $this->CentreGroupe;
  119.     }
  120.     public function setCentreGroupe(?CentreGroupe $CentreGroupe): self
  121.     {
  122.         $this->CentreGroupe $CentreGroupe;
  123.         return $this;
  124.     }
  125. }