コード例 #1
0
ファイル: SkillQuery.php プロジェクト: gossi/trixionary
 /**
  * Filter the query by a related \gossi\trixionary\model\Lineage object
  *
  * @param \gossi\trixionary\model\Lineage|ObjectCollection $lineage the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildSkillQuery The current query, for fluid interface
  */
 public function filterByLineageRelatedByAncestorId($lineage, $comparison = null)
 {
     if ($lineage instanceof \gossi\trixionary\model\Lineage) {
         return $this->addUsingAlias(SkillTableMap::COL_ID, $lineage->getAncestorId(), $comparison);
     } elseif ($lineage instanceof ObjectCollection) {
         return $this->useLineageRelatedByAncestorIdQuery()->filterByPrimaryKeys($lineage->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByLineageRelatedByAncestorId() only accepts arguments of type \\gossi\\trixionary\\model\\Lineage or Collection');
     }
 }
コード例 #2
0
 /**
  * Internal mechanism to set the Ancestor id
  * 
  * @param Lineage $model
  * @param mixed $relatedId
  */
 protected function doSetAncestorId(Lineage $model, $relatedId)
 {
     if ($model->getAncestorId() !== $relatedId) {
         $model->setAncestorId($relatedId);
         return true;
     }
     return false;
 }