Ejemplo n.º 1
0
	/**
	 * Declares an association between this object and a Mef object.
	 *
	 * @param      Mef $v
	 * @return     Eleve The current object (for fluent API support)
	 * @throws     PropelException
	 */
	public function setMef(Mef $v = null)
	{
		if ($v === null) {
			$this->setMefCode(NULL);
		} else {
			$this->setMefCode($v->getMefCode());
		}

		$this->aMef = $v;

		// Add binding for other direction of this n:n relationship.
		// If this object has already been added to the Mef object, it will not be re-added.
		if ($v !== null) {
			$v->addEleve($this);
		}

		return $this;
	}
Ejemplo n.º 2
0
	/**
	 * Exclude object from result
	 *
	 * @param     Mef $mef Object to remove from the list of results
	 *
	 * @return    MefQuery The current query, for fluid interface
	 */
	public function prune($mef = null)
	{
		if ($mef) {
			$this->addUsingAlias(MefPeer::ID, $mef->getId(), Criteria::NOT_EQUAL);
		}

		return $this;
	}
Ejemplo n.º 3
0
function ajoutMefParDefaut() {
    $mef = new Mef();
    //$mef->setMefCode("1031000111");
    //$mef->setLibelleCourt("3G");
    $mef->setMefCode("1031001911");
    $mef->setLibelleCourt("3EME");
    $mef->setLibelleLong("3EME");
    $mef->setLibelleEdition("3eme");
    if (MefQuery::create()->filterByMefCode($mef->getMefCode())->find()->isEmpty()) {
	$mef->save();
    }

    $mef = new Mef();
    $mef->setMefCode("1021000111");
    $mef->setLibelleCourt("4G");
    $mef->setLibelleLong("4EME");
    $mef->setLibelleEdition("4eme");
    if (MefQuery::create()->filterByMefCode($mef->getMefCode())->find()->isEmpty()) {
	$mef->save();
    }

    $mef = new Mef();
    $mef->setMefCode("1011000111");
    $mef->setLibelleCourt("5G");
    $mef->setLibelleLong("5EME");
    $mef->setLibelleEdition("5eme");
    if (MefQuery::create()->filterByMefCode($mef->getMefCode())->find()->isEmpty()) {
	$mef->save();
    }

    $mef = new Mef();
    //$mef->setMefCode("1001000111");
    //$mef->setLibelleCourt("6G");
    $mef->setMefCode("1001001211");
    $mef->setLibelleCourt("6EME");
    $mef->setLibelleLong("6EME");
    $mef->setLibelleEdition("6eme");
    if (MefQuery::create()->filterByMefCode($mef->getMefCode())->find()->isEmpty()) {
	$mef->save();
    }
}
Ejemplo n.º 4
0
	/**
	 * Filter the query by a related Mef object
	 *
	 * @param     Mef|PropelCollection $mef The related object(s) to use as filter
	 * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
	 *
	 * @return    EleveQuery The current query, for fluid interface
	 */
	public function filterByMef($mef, $comparison = null)
	{
		if ($mef instanceof Mef) {
			return $this
				->addUsingAlias(ElevePeer::MEF_CODE, $mef->getMefCode(), $comparison);
		} elseif ($mef instanceof PropelCollection) {
			if (null === $comparison) {
				$comparison = Criteria::IN;
			}
			return $this
				->addUsingAlias(ElevePeer::MEF_CODE, $mef->toKeyValue('PrimaryKey', 'MefCode'), $comparison);
		} else {
			throw new PropelException('filterByMef() only accepts arguments of type Mef or PropelCollection');
		}
	}