<?phpnamespace App\Entity\Referentiel;use Doctrine\ORM\Mapping as ORM;use App\Entity\AssistantMaternel\AssistantMaternel;/** * @ORM\Entity * @ORM\Table(name="efc.ref_commune") */class Commune { // TODO factoriser avec des traits (ex : code postal) use \App\Entity\Commun\IdTrait;// <editor-fold defaultstate="collapsed" desc="Attributs privés"> /** * @ORM\Column(type="string", length=70) */ private $code_externe; /** * @ORM\Column(type="string", length=5) */ private $code_insee; /** * @ORM\Column(type="string", length=5) */ private $code_postal; /** * @ORM\Column(type="string", length=100) */ private $libelle; /** * @ORM\OneToMany(targetEntity="App\Entity\AssistantMaternel\AssistantMaternel", mappedBy="commune") */ private $assmats; /** * @ORM\OneToMany(targetEntity="App\Entity\MAM\MAM", mappedBy="commune") */ private $mams; /** * @ORM\ManyToMany(targetEntity="App\Entity\Referentiel\Canton", inversedBy="communes") * @ORM\JoinTable(name="efc.ref_communes_cantons") */ private $cantons;// </editor-fold>// <editor-fold desc="Accesseurs"> /** * Set libelle * * @param string $libelle * * @return Commune */ public function setLibelle($libelle) { $this->libelle = $libelle; return $this; } /** * Get libelle * * @return string */ public function getLibelle() { return $this->libelle; } /** * Get assmats * * @return \Doctrine\Common\Collections\Collection */ public function getAssistantsMaternels() { return $this->assmats; } /** * Set codeExterne * * @param integer $code_externe * * @return Commune */ public function setCodeExterne($code_externe) { $this->code_externe = $code_externe; return $this; } /** * Get codeExterne * * @return integer */ public function getCodeExterne() { return $this->code_externe; } /** * Set codeInsee * * @param string $codeInsee * * @return Commune */ public function setCodeInsee($codeInsee) { $this->code_insee = $codeInsee; return $this; } /** * Get codeInsee * * @return string */ public function getCodeInsee() { return $this->code_insee; } /** * Set codePostal * * @param string $codePostal * * @return Commune */ public function setCodePostal($codePostal) { $this->code_postal = $codePostal; return $this; } /** * Get codePostal * * @return string */ public function getCodePostal() { return $this->code_postal; } /** * Get canton * * @return Canton */ public function getCantons() { return $this->cantons; }// </editor-fold>// <editor-fold desc="Méthodes publiques"> /** * Constructor */ public function __construct() { } public function __toString() { return $this->libelle; } /** * Add assmat * * @param AssistantMaternel $assmat * * @return Commune */ public function addAssistantMaternel(AssistantMaternel $assmat) { $this->assmats[] = $assmat; return $this; } /** * Remove assmat * * @param AssistantMaternel $assmat */ public function removeAssistantMaternel(AssistantMaternel $assmat) { $this->assmats->removeElement($assmat); } /** * Add canton * * @param Canton $canton * * @return Canton */ public function addCanton(Commune $canton) { $this->cantons[] = $canton; return $this; } /** * Remove canton * * @param Canton $canton */ public function removeCanton(Canton $canton) { $this->cantons->removeElement($canton); }// </editor-fold>}