Exemplo n.º 1
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');
		}
	}