src/Entity/Centre.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\CentreGroupe;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\CentreRepository;
  6. use Doctrine\ORM\EntityManagerInterface;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. /**
  10.  * @ORM\Entity(repositoryClass=CentreRepository::class)
  11.  */
  12. class Centre
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $ctr_nom;
  24.     /**
  25.      * @ORM\Column(type="string", length=15)
  26.      */
  27.     private $ctr_telephone;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $ctr_email;
  32.     /**
  33.      * @ORM\Column(type="string", length=15, nullable=true)
  34.      */
  35.     private $ctr_fax;
  36.     /**
  37.      * @ORM\Column(type="string", length=8)
  38.      */
  39.     private $ctr_agrement;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=SmsRelance::class, mappedBy="centre")
  42.      */
  43.     private $smsRelances;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Sms::class, mappedBy="centre")
  46.      */
  47.     private $sms;
  48.     /**
  49.      * @ORM\OneToOne(targetEntity=Adresse::class, cascade={"persist", "remove"}, fetch="EAGER")
  50.      * @ORM\JoinColumn(nullable=false)
  51.      */
  52.     private $ctr_adresse;
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity=CentreGroupe::class, inversedBy="centres")
  55.      * @ORM\JoinColumn(nullable=false)
  56.      */
  57.     private $centre_groupe;
  58.     /**
  59.      * @ORM\ManyToOne(targetEntity=CentreType::class, inversedBy="centres", fetch="EAGER")
  60.      * @ORM\JoinColumn(nullable=false)
  61.      */
  62.     private $centre_type;
  63.     /**
  64.      * @ORM\OneToOne(targetEntity=ParametreCentre::class, inversedBy="centre", cascade={"persist", "remove"}, fetch="EAGER")
  65.      * @ORM\JoinColumn(nullable=false)
  66.      */
  67.     private $ctr_parametre_centre;
  68.     /**
  69.      * @ORM\OneToOne(targetEntity=ParametreCentreAdmin::class, inversedBy="centre", cascade={"persist", "remove"}, fetch="EAGER")
  70.      * @ORM\JoinColumn(nullable=true)
  71.      */
  72.     private $ctr_parametre_centre_admin;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity=CentreHoraire::class, mappedBy="centre", orphanRemoval=true, fetch="EAGER")
  75.      */
  76.     private $centreHoraires;
  77.     /**
  78.      * @ORM\Column(type="integer", nullable=true)
  79.      */
  80.     private $id_old;
  81.     protected $em;
  82.     public function __construct()
  83.     {
  84.         $this->smsRelances = new ArrayCollection();
  85.         $this->sms = new ArrayCollection();
  86.         $this->centreHoraires = new ArrayCollection();
  87.     }
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getCtrNom(): ?string
  93.     {
  94.         return $this->ctr_nom;
  95.     }
  96.     public function setCtrNom(string $ctr_nom): self
  97.     {
  98.         $this->ctr_nom $ctr_nom;
  99.         return $this;
  100.     }
  101.     public function getCtrTelephone(): ?string
  102.     {
  103.         return $this->ctr_telephone;
  104.     }
  105.     public function setCtrTelephone(string $ctr_telephone): self
  106.     {
  107.         $this->ctr_telephone preg_replace('/\D/'''$ctr_telephone);
  108.         return $this;
  109.     }
  110.     public function getCtrEmail(): ?string
  111.     {
  112.         return $this->ctr_email;
  113.     }
  114.     public function setCtrEmail(string $ctr_email): self
  115.     {
  116.         $this->ctr_email $ctr_email;
  117.         return $this;
  118.     }
  119.     public function getCtrFax(): ?string
  120.     {
  121.         return $this->ctr_fax;
  122.     }
  123.     public function setCtrFax(?string $ctr_fax): self
  124.     {
  125.         $this->ctr_fax $ctr_fax;
  126.         return $this;
  127.     }
  128.     public function getCtrAgrement(): ?string
  129.     {
  130.         return $this->ctr_agrement;
  131.     }
  132.     public function setCtrAgrement(string $ctr_agrement): self
  133.     {
  134.         $this->ctr_agrement $ctr_agrement;
  135.         return $this;
  136.     }
  137.     /**
  138.      * @return Collection<int, SmsRelance>
  139.      */
  140.     public function getSmsRelances(): Collection
  141.     {
  142.         return $this->smsRelances;
  143.     }
  144.     public function addSmsRelance(SmsRelance $smsRelance): self
  145.     {
  146.         if (!$this->smsRelances->contains($smsRelance)) {
  147.             $this->smsRelances[] = $smsRelance;
  148.             $smsRelance->setCentre($this);
  149.         }
  150.         return $this;
  151.     }
  152.     public function removeSmsRelance(SmsRelance $smsRelance): self
  153.     {
  154.         if ($this->smsRelances->removeElement($smsRelance)) {
  155.             // set the owning side to null (unless already changed)
  156.             if ($smsRelance->getCentre() === $this) {
  157.                 $smsRelance->setCentre(null);
  158.             }
  159.         }
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return Collection<int, Sms>
  164.      */
  165.     public function getSms(): Collection
  166.     {
  167.         return $this->sms;
  168.     }
  169.     public function addSms(Sms $sms): self
  170.     {
  171.         if (!$this->sms->contains($sms)) {
  172.             $this->sms[] = $sms;
  173.             $sms->setCentre($this);
  174.         }
  175.         return $this;
  176.     }
  177.     public function removeSms(Sms $sms): self
  178.     {
  179.         if ($this->sms->removeElement($sms)) {
  180.             // set the owning side to null (unless already changed)
  181.             if ($sms->getCentre() === $this) {
  182.                 $sms->setCentre(null);
  183.             }
  184.         }
  185.         return $this;
  186.     }
  187.     public function getCtrAdresse(): ?Adresse
  188.     {
  189.         return $this->ctr_adresse;
  190.     }
  191.     public function setCtrAdresse(Adresse $ctr_adresse): self
  192.     {
  193.         $this->ctr_adresse $ctr_adresse;
  194.         return $this;
  195.     }
  196.     public function getCentreGroupe(): ?CentreGroupe
  197.     {
  198.         return $this->centre_groupe;
  199.     }
  200.     public function setCentreGroupe(?CentreGroupe $ctr_centre_groupe): self
  201.     {
  202.         $this->centre_groupe $ctr_centre_groupe;
  203.         return $this;
  204.     }
  205.     public function getCentreType(): ?CentreType
  206.     {
  207.         return $this->centre_type;
  208.     }
  209.     public function setCentreType(?CentreType $centre_type): self
  210.     {
  211.         $this->centre_type $centre_type;
  212.         return $this;
  213.     }
  214.     public function getCtrParametreCentre(): ?ParametreCentre
  215.     {
  216.         return $this->ctr_parametre_centre;
  217.     }
  218.     public function setCtrParametreCentre(ParametreCentre $ctr_parametre_centre): self
  219.     {
  220.         $this->ctr_parametre_centre $ctr_parametre_centre;
  221.         return $this;
  222.     }
  223.     public function getCtrParametreCentreAdmin(): ?ParametreCentreAdmin
  224.     {
  225.         return $this->ctr_parametre_centre_admin;
  226.     }
  227.     public function setCtrParametreCentreAdmin(ParametreCentreAdmin $ctr_parametre_centre_admin): self
  228.     {
  229.         $this->ctr_parametre_centre_admin $ctr_parametre_centre_admin;
  230.         return $this;
  231.     }
  232.     /**
  233.      * @return Collection<int, CentreHoraire>
  234.      */
  235.     public function getCentreHoraires(): Collection
  236.     {
  237.         return $this->centreHoraires;
  238.     }
  239.     public function addCentreHoraire(CentreHoraire $centreHoraire): self
  240.     {
  241.         if (!$this->centreHoraires->contains($centreHoraire)) {
  242.             $this->centreHoraires[] = $centreHoraire;
  243.             $centreHoraire->setCentre($this);
  244.         }
  245.         return $this;
  246.     }
  247.     public function removeCentreHoraire(CentreHoraire $centreHoraire): self
  248.     {
  249.         if ($this->centreHoraires->removeElement($centreHoraire)) {
  250.             // set the owning side to null (unless already changed)
  251.             if ($centreHoraire->getCentre() === $this) {
  252.                 $centreHoraire->setCentre(null);
  253.             }
  254.         }
  255.         return $this;
  256.     }
  257.     public function getIdOld(): ?int
  258.     {
  259.         return $this->id_old;
  260.     }
  261.     public function setIdOld(int $id_old): self
  262.     {
  263.         $this->id_old $id_old;
  264.         return $this;
  265.     }
  266. }