src/Entity/Financeurs.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FinanceursRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FinanceursRepository::class)
  9.  */
  10. class Financeurs
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=100)
  20.      */
  21.     private $libelle;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Dossier::class, mappedBy="financeur")
  24.      */
  25.     private $dossiers;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Contact::class, mappedBy="financeurs")
  28.      */
  29.     private $contacts;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Dispositif::class, mappedBy="financeur", orphanRemoval=true)
  32.      */
  33.     private $dispositifs;
  34.     public function __construct()
  35.     {
  36.         $this->operations = new ArrayCollection();
  37.         $this->dossiers = new ArrayCollection();
  38.         $this->contacts = new ArrayCollection();
  39.         $this->dispositifs = new ArrayCollection();
  40.     }
  41.     
  42.     public function __toString()
  43.     {
  44.         return (string) $this->getLibelle();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getLibelle(): ?string
  51.     {
  52.         return $this->libelle;
  53.     }
  54.     public function setLibelle(string $libelle): self
  55.     {
  56.         $this->libelle $libelle;
  57.         return $this;
  58.     }
  59.  
  60.     /**
  61.      * @return Collection<int, Dossier>
  62.      */
  63.     public function getDossiers(): Collection
  64.     {
  65.         return $this->dossiers;
  66.     }
  67.     public function addDossier(Dossier $dossier): self
  68.     {
  69.         if (!$this->dossiers->contains($dossier)) {
  70.             $this->dossiers[] = $dossier;
  71.             $dossier->setFinanceur($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeDossier(Dossier $dossier): self
  76.     {
  77.         if ($this->dossiers->removeElement($dossier)) {
  78.             // set the owning side to null (unless already changed)
  79.             if ($dossier->getFinanceur() === $this) {
  80.                 $dossier->setFinanceur(null);
  81.             }
  82.         }
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection<int, Contact>
  87.      */
  88.     public function getContacts(): Collection
  89.     {
  90.         return $this->contacts;
  91.     }
  92.     public function addContact(Contact $contact): self
  93.     {
  94.         if (!$this->contacts->contains($contact)) {
  95.             $this->contacts[] = $contact;
  96.             $contact->setFinanceurs($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeContact(Contact $contact): self
  101.     {
  102.         if ($this->contacts->removeElement($contact)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($contact->getFinanceurs() === $this) {
  105.                 $contact->setFinanceurs(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, Dispositif>
  112.      */
  113.     public function getDispositifs(): Collection
  114.     {
  115.         return $this->dispositifs;
  116.     }
  117.     public function addDispositif(Dispositif $dispositif): self
  118.     {
  119.         if (!$this->dispositifs->contains($dispositif)) {
  120.             $this->dispositifs[] = $dispositif;
  121.             $dispositif->setFinanceur($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeDispositif(Dispositif $dispositif): self
  126.     {
  127.         if ($this->dispositifs->removeElement($dispositif)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($dispositif->getFinanceur() === $this) {
  130.                 $dispositif->setFinanceur(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135. }