Esempio n. 1
0
 /**
  * Ajout d'un materiel à un centre.
  *
  * @param SDIS62\Core\Ops\Entity\Centre $centre
  * @param string                        $name
  */
 public function __construct(Centre $centre, $name)
 {
     $this->name = $name;
     $this->centre = $centre;
     $this->centre->addMateriel($this);
     $this->engagements = new ArrayCollection();
     $this->statut = Statut::DISPONIBLE();
 }
Esempio n. 2
0
 /**
  * Set the value of Centre dans lequel le pompier est affecté.
  *
  * @param SDIS62\Core\Ops\Entity\Centre centre
  *
  * @return self
  */
 public function setCentre(Centre $centre)
 {
     if (!empty($this->centre)) {
         $this->centre->getPompiers()->removeElement($this);
     }
     $this->centre = $centre;
     $this->centre->addPompier($this);
     return $this;
 }