<?php
namespace App\Entity;
use App\Repository\AssuranceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AssuranceRepository::class)
*/
class Assurance
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $designation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $adresse;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $logo;
/**
* @ORM\OneToMany(targetEntity=Carte::class, mappedBy="assurance", orphanRemoval=true)
*/
private $cartes;
/**
* @ORM\OneToMany(targetEntity=Adherer::class, mappedBy="assurance", orphanRemoval=true)
*/
private $adherers;
/**
* @ORM\ManyToMany(targetEntity=IctusPharmacie::class, inversedBy="assurances")
*/
private $pharmacie;
/**
* @ORM\OneToMany(targetEntity=PrisEnCharge::class, mappedBy="assurance")
*/
private $prisEnCharges;
public function __construct()
{
$this->cartes = new ArrayCollection();
$this->adherers = new ArrayCollection();
$this->pharmacie = new ArrayCollection();
$this->prisEnCharges = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(string $designation): self
{
$this->designation = $designation;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getLogo(): ?string
{
return $this->logo;
}
public function setLogo(?string $logo): self
{
$this->logo = $logo;
return $this;
}
/**
* @return Collection<int, Carte>
*/
public function getCartes(): Collection
{
return $this->cartes;
}
public function addCarte(Carte $carte): self
{
if (!$this->cartes->contains($carte)) {
$this->cartes[] = $carte;
$carte->setAssurance($this);
}
return $this;
}
public function removeCarte(Carte $carte): self
{
if ($this->cartes->removeElement($carte)) {
// set the owning side to null (unless already changed)
if ($carte->getAssurance() === $this) {
$carte->setAssurance(null);
}
}
return $this;
}
/**
* @return Collection<int, Adherer>
*/
public function getAdherers(): Collection
{
return $this->adherers;
}
public function addAdherer(Adherer $adherer): self
{
if (!$this->adherers->contains($adherer)) {
$this->adherers[] = $adherer;
$adherer->setAssurance($this);
}
return $this;
}
public function removeAdherer(Adherer $adherer): self
{
if ($this->adherers->removeElement($adherer)) {
// set the owning side to null (unless already changed)
if ($adherer->getAssurance() === $this) {
$adherer->setAssurance(null);
}
}
return $this;
}
/**
* @return Collection<int, IctusPharmacie>
*/
public function getPharmacie(): Collection
{
return $this->pharmacie;
}
public function addPharmacie(IctusPharmacie $pharmacie): self
{
if (!$this->pharmacie->contains($pharmacie)) {
$this->pharmacie[] = $pharmacie;
}
return $this;
}
public function removePharmacie(IctusPharmacie $pharmacie): self
{
$this->pharmacie->removeElement($pharmacie);
return $this;
}
/**
* @return Collection<int, PrisEnCharge>
*/
public function getPrisEnCharges(): Collection
{
return $this->prisEnCharges;
}
public function addPrisEnCharge(PrisEnCharge $prisEnCharge): self
{
if (!$this->prisEnCharges->contains($prisEnCharge)) {
$this->prisEnCharges[] = $prisEnCharge;
$prisEnCharge->setAssurance($this);
}
return $this;
}
public function removePrisEnCharge(PrisEnCharge $prisEnCharge): self
{
if ($this->prisEnCharges->removeElement($prisEnCharge)) {
// set the owning side to null (unless already changed)
if ($prisEnCharge->getAssurance() === $this) {
$prisEnCharge->setAssurance(null);
}
}
return $this;
}
public function removeAllAdherant()
{
foreach ($this->adherers as $adherer) {
$this->removeAdherer($adherer);
}
}
}