src/Entity/Center.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity
  8.  * @ORM\Table(name="mmpp_center")
  9.  */
  10. class Center
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     protected $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     protected $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     protected $slug;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity="FormationGroup", mappedBy="center")
  28.      */
  29.     protected $groups;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity="Preinscription", mappedBy="center")
  32.      */
  33.     protected $preinscriptions;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity="Config", mappedBy="center")
  36.      */
  37.     protected $configs;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="InscriptionFileLog", mappedBy="center")
  40.      */
  41.     protected $inscriptionlogs;
  42.     public function __construct()
  43.     {
  44.         $this->groups = new ArrayCollection();
  45.         $this->preinscriptions = new ArrayCollection();
  46.         $this->configs = new ArrayCollection();
  47.         $this->inscriptionlogs = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(string $name): self
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     public function getSlug(): ?string
  63.     {
  64.         return $this->slug;
  65.     }
  66.     public function setSlug(string $slug): self
  67.     {
  68.         $this->slug $slug;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, FormationGroup>
  73.      */
  74.     public function getGroups(): Collection
  75.     {
  76.         return $this->groups;
  77.     }
  78.     public function addGroup(FormationGroup $group): self
  79.     {
  80.         if (!$this->groups->contains($group)) {
  81.             $this->groups->add($group);
  82.             $group->setCenter($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeGroup(FormationGroup $group): self
  87.     {
  88.         if ($this->groups->removeElement($group)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($group->getCenter() === $this) {
  91.                 $group->setCenter(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, Preinscription>
  98.      */
  99.     public function getPreinscriptions(): Collection
  100.     {
  101.         return $this->preinscriptions;
  102.     }
  103.     public function addPreinscription(Preinscription $preinscription): self
  104.     {
  105.         if (!$this->preinscriptions->contains($preinscription)) {
  106.             $this->preinscriptions->add($preinscription);
  107.             $preinscription->setCenter($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removePreinscription(Preinscription $preinscription): self
  112.     {
  113.         if ($this->preinscriptions->removeElement($preinscription)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($preinscription->getCenter() === $this) {
  116.                 $preinscription->setCenter(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, Config>
  123.      */
  124.     public function getConfigs(): Collection
  125.     {
  126.         return $this->configs;
  127.     }
  128.     public function addConfig(Config $config): self
  129.     {
  130.         if (!$this->configs->contains($config)) {
  131.             $this->configs->add($config);
  132.             $config->setCenter($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeConfig(Config $config): self
  137.     {
  138.         if ($this->configs->removeElement($config)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($config->getCenter() === $this) {
  141.                 $config->setCenter(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection<int, InscriptionFileLog>
  148.      */
  149.     public function getInscriptionlogs(): Collection
  150.     {
  151.         return $this->inscriptionlogs;
  152.     }
  153.     public function addInscriptionlog(InscriptionFileLog $inscriptionlog): self
  154.     {
  155.         if (!$this->inscriptionlogs->contains($inscriptionlog)) {
  156.             $this->inscriptionlogs->add($inscriptionlog);
  157.             $inscriptionlog->setCenter($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeInscriptionlog(InscriptionFileLog $inscriptionlog): self
  162.     {
  163.         if ($this->inscriptionlogs->removeElement($inscriptionlog)) {
  164.             // set the owning side to null (unless already changed)
  165.             if ($inscriptionlog->getCenter() === $this) {
  166.                 $inscriptionlog->setCenter(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171. }