<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="mmpp_center")
*/
class Center
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=255)
*/
protected $name;
/**
* @ORM\Column(type="string", length=255)
*/
protected $slug;
/**
* @ORM\OneToMany(targetEntity="FormationGroup", mappedBy="center")
*/
protected $groups;
/**
* @ORM\OneToMany(targetEntity="Preinscription", mappedBy="center")
*/
protected $preinscriptions;
/**
* @ORM\OneToMany(targetEntity="Config", mappedBy="center")
*/
protected $configs;
/**
* @ORM\OneToMany(targetEntity="InscriptionFileLog", mappedBy="center")
*/
protected $inscriptionlogs;
public function __construct()
{
$this->groups = new ArrayCollection();
$this->preinscriptions = new ArrayCollection();
$this->configs = new ArrayCollection();
$this->inscriptionlogs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, FormationGroup>
*/
public function getGroups(): Collection
{
return $this->groups;
}
public function addGroup(FormationGroup $group): self
{
if (!$this->groups->contains($group)) {
$this->groups->add($group);
$group->setCenter($this);
}
return $this;
}
public function removeGroup(FormationGroup $group): self
{
if ($this->groups->removeElement($group)) {
// set the owning side to null (unless already changed)
if ($group->getCenter() === $this) {
$group->setCenter(null);
}
}
return $this;
}
/**
* @return Collection<int, Preinscription>
*/
public function getPreinscriptions(): Collection
{
return $this->preinscriptions;
}
public function addPreinscription(Preinscription $preinscription): self
{
if (!$this->preinscriptions->contains($preinscription)) {
$this->preinscriptions->add($preinscription);
$preinscription->setCenter($this);
}
return $this;
}
public function removePreinscription(Preinscription $preinscription): self
{
if ($this->preinscriptions->removeElement($preinscription)) {
// set the owning side to null (unless already changed)
if ($preinscription->getCenter() === $this) {
$preinscription->setCenter(null);
}
}
return $this;
}
/**
* @return Collection<int, Config>
*/
public function getConfigs(): Collection
{
return $this->configs;
}
public function addConfig(Config $config): self
{
if (!$this->configs->contains($config)) {
$this->configs->add($config);
$config->setCenter($this);
}
return $this;
}
public function removeConfig(Config $config): self
{
if ($this->configs->removeElement($config)) {
// set the owning side to null (unless already changed)
if ($config->getCenter() === $this) {
$config->setCenter(null);
}
}
return $this;
}
/**
* @return Collection<int, InscriptionFileLog>
*/
public function getInscriptionlogs(): Collection
{
return $this->inscriptionlogs;
}
public function addInscriptionlog(InscriptionFileLog $inscriptionlog): self
{
if (!$this->inscriptionlogs->contains($inscriptionlog)) {
$this->inscriptionlogs->add($inscriptionlog);
$inscriptionlog->setCenter($this);
}
return $this;
}
public function removeInscriptionlog(InscriptionFileLog $inscriptionlog): self
{
if ($this->inscriptionlogs->removeElement($inscriptionlog)) {
// set the owning side to null (unless already changed)
if ($inscriptionlog->getCenter() === $this) {
$inscriptionlog->setCenter(null);
}
}
return $this;
}
}