src/Entity/Assurance.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AssuranceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=AssuranceRepository::class)
  9.  */
  10. class Assurance
  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 $designation;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $adresse;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $logo;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Carte::class, mappedBy="assurance", orphanRemoval=true)
  32.      */
  33.     private $cartes;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Adherer::class, mappedBy="assurance", orphanRemoval=true)
  36.      */
  37.     private $adherers;
  38.     /**
  39.      * @ORM\ManyToMany(targetEntity=IctusPharmacie::class, inversedBy="assurances")
  40.      */
  41.     private $pharmacie;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=PrisEnCharge::class, mappedBy="assurance")
  44.      */
  45.     private $prisEnCharges;
  46.     public function __construct()
  47.     {
  48.         $this->cartes = new ArrayCollection();
  49.         $this->adherers = new ArrayCollection();
  50.         $this->pharmacie = new ArrayCollection();
  51.         $this->prisEnCharges = new ArrayCollection();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getDesignation(): ?string
  58.     {
  59.         return $this->designation;
  60.     }
  61.     public function setDesignation(string $designation): self
  62.     {
  63.         $this->designation $designation;
  64.         return $this;
  65.     }
  66.     public function getAdresse(): ?string
  67.     {
  68.         return $this->adresse;
  69.     }
  70.     public function setAdresse(?string $adresse): self
  71.     {
  72.         $this->adresse $adresse;
  73.         return $this;
  74.     }
  75.     public function getLogo(): ?string
  76.     {
  77.         return $this->logo;
  78.     }
  79.     public function setLogo(?string $logo): self
  80.     {
  81.         $this->logo $logo;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return Collection<int, Carte>
  86.      */
  87.     public function getCartes(): Collection
  88.     {
  89.         return $this->cartes;
  90.     }
  91.     public function addCarte(Carte $carte): self
  92.     {
  93.         if (!$this->cartes->contains($carte)) {
  94.             $this->cartes[] = $carte;
  95.             $carte->setAssurance($this);
  96.         }
  97.         return $this;
  98.     }
  99.     public function removeCarte(Carte $carte): self
  100.     {
  101.         if ($this->cartes->removeElement($carte)) {
  102.             // set the owning side to null (unless already changed)
  103.             if ($carte->getAssurance() === $this) {
  104.                 $carte->setAssurance(null);
  105.             }
  106.         }
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return Collection<int, Adherer>
  111.      */
  112.     public function getAdherers(): Collection
  113.     {
  114.         return $this->adherers;
  115.     }
  116.     public function addAdherer(Adherer $adherer): self
  117.     {
  118.         if (!$this->adherers->contains($adherer)) {
  119.             $this->adherers[] = $adherer;
  120.             $adherer->setAssurance($this);
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeAdherer(Adherer $adherer): self
  125.     {
  126.         if ($this->adherers->removeElement($adherer)) {
  127.             // set the owning side to null (unless already changed)
  128.             if ($adherer->getAssurance() === $this) {
  129.                 $adherer->setAssurance(null);
  130.             }
  131.         }
  132.         return $this;
  133.     }
  134.     /**
  135.      * @return Collection<int, IctusPharmacie>
  136.      */
  137.     public function getPharmacie(): Collection
  138.     {
  139.         return $this->pharmacie;
  140.     }
  141.     public function addPharmacie(IctusPharmacie $pharmacie): self
  142.     {
  143.         if (!$this->pharmacie->contains($pharmacie)) {
  144.             $this->pharmacie[] = $pharmacie;
  145.         }
  146.         return $this;
  147.     }
  148.     public function removePharmacie(IctusPharmacie $pharmacie): self
  149.     {
  150.         $this->pharmacie->removeElement($pharmacie);
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, PrisEnCharge>
  155.      */
  156.     public function getPrisEnCharges(): Collection
  157.     {
  158.         return $this->prisEnCharges;
  159.     }
  160.     public function addPrisEnCharge(PrisEnCharge $prisEnCharge): self
  161.     {
  162.         if (!$this->prisEnCharges->contains($prisEnCharge)) {
  163.             $this->prisEnCharges[] = $prisEnCharge;
  164.             $prisEnCharge->setAssurance($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removePrisEnCharge(PrisEnCharge $prisEnCharge): self
  169.     {
  170.         if ($this->prisEnCharges->removeElement($prisEnCharge)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($prisEnCharge->getAssurance() === $this) {
  173.                 $prisEnCharge->setAssurance(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeAllAdherant()
  179.     {
  180.         foreach ($this->adherers as $adherer) {
  181.             $this->removeAdherer($adherer);
  182.         }
  183.     }
  184. }