fix several use cases in updateAncestorsTree

This commit is contained in:
Toni Uebernickel 2012-02-01 12:08:31 +01:00
commit 33acc67b63
2 changed files with 89 additions and 46 deletions

View file

@ -94,4 +94,23 @@ class ObjectIdentityQuery extends BaseObjectIdentityQuery
->find($con)
;
}
/**
* Return all ancestors of the given object identity.
*
* @param ObjectIdentity $objectIdentity
* @param PropelPDO $con
*
* @return PropelCollection
*/
public function findAncestors(ObjectIdentity $objectIdentity, PropelPDO $con = null)
{
return $this
->useObjectIdentityAncestorRelatedByAncestorIdQuery()
->filterByObjectIdentityRelatedByObjectIdentityId($objectIdentity)
->filterByObjectIdentityRelatedByAncestorId($objectIdentity, Criteria::NOT_EQUAL)
->endUse()
->find($con)
;
}
}