コード例 #1
0
ファイル: BaseJAidElevesQuery.php プロジェクト: rhertzog/lcs
	/**
	 * Returns a new JAidElevesQuery object.
	 *
	 * @param     string $modelAlias The alias of a model in the query
	 * @param     Criteria $criteria Optional Criteria to build the query from
	 *
	 * @return    JAidElevesQuery
	 */
	public static function create($modelAlias = null, $criteria = null)
	{
		if ($criteria instanceof JAidElevesQuery) {
			return $criteria;
		}
		$query = new JAidElevesQuery();
		if (null !== $modelAlias) {
			$query->setModelAlias($modelAlias);
		}
		if ($criteria instanceof Criteria) {
			$query->mergeWith($criteria);
		}
		return $query;
	}
コード例 #2
0
ファイル: BaseAidDetails.php プロジェクト: rhertzog/lcs
	/**
	 * Sets a collection of Eleve objects related by a many-to-many relationship
	 * to the current object by way of the j_aid_eleves cross-reference table.
	 * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
	 * and new objects from the given Propel collection.
	 *
	 * @param      PropelCollection $eleves A Propel collection.
	 * @param      PropelPDO $con Optional connection object
	 */
	public function setEleves(PropelCollection $eleves, PropelPDO $con = null)
	{
		$jAidElevess = JAidElevesQuery::create()
			->filterByEleve($eleves)
			->filterByAidDetails($this)
			->find($con);

		$this->elevesScheduledForDeletion = $this->getJAidElevess()->diff($jAidElevess);
		$this->collJAidElevess = $jAidElevess;

		foreach ($eleves as $eleve) {
			// Fix issue with collection modified by reference
			if ($eleve->isNew()) {
				$this->doAddEleve($eleve);
			} else {
				$this->addEleve($eleve);
			}
		}

		$this->collEleves = $eleves;
	}