Ejemplo n.º 1
0
	/**
	 * @param	JEleveProfesseurPrincipal $jEleveProfesseurPrincipal The jEleveProfesseurPrincipal object to add.
	 */
	protected function doAddJEleveProfesseurPrincipal($jEleveProfesseurPrincipal)
	{
		$this->collJEleveProfesseurPrincipals[]= $jEleveProfesseurPrincipal;
		$jEleveProfesseurPrincipal->setEleve($this);
	}
Ejemplo n.º 2
0
	/**
	 * Ajoute un eleve au cpe ou au professeur principal
	 * le statut doit etre cpe ou professeur
	 *
	 * @param      Eleve $eleve The JEleveCpe object to relate
	 * @return     void
	 */
	public function addEleve($eleve)
	{
		if ($this->statut != "cpe" && $this->statut != "professeur") {
		    throw new PropelException("le statut de l'utilisateur doit etre cpe ou professeur");
		}
		if ($this->collEleves === null) {
		    $this->initEleves();
		}

		if (!$this->collEleves->contains($eleve)) { // only add it if the **same** object is not already associated
		    if ($this->statut == "cpe") {
			$jEleveCpe = new JEleveCpe();
			$jEleveCpe->setEleve($eleve);
			$this->addJEleveCpe($jEleveCpe);

			$this->collEleves[]= $eleve;
		    } else if ($this->statut == "professeur") {
			$jEleveProfesseurPrincipal = new JEleveProfesseurPrincipal();
			$jEleveProfesseurPrincipal->setEleve($eleve);
			$this->addJEleveProfesseurPrincipal($jEleveProfesseurPrincipal);

			$this->collEleves[]= $eleve;

		    }
		}
	}