add handling of parent ACL
* fix ObjectIdentityQuery::findGrandChildren
This commit is contained in:
parent
bfaa408df1
commit
3524cd8a6b
5 changed files with 145 additions and 15 deletions
|
|
@ -10,7 +10,9 @@
|
|||
|
||||
namespace Propel\PropelBundle\Model\Acl;
|
||||
|
||||
use Criteria;
|
||||
use PropelPDO;
|
||||
use PropelCollection;
|
||||
|
||||
use Propel\PropelBundle\Model\Acl\ObjectIdentity;
|
||||
use Propel\PropelBundle\Model\Acl\om\BaseObjectIdentityQuery;
|
||||
|
|
@ -56,4 +58,39 @@ class ObjectIdentityQuery extends BaseObjectIdentityQuery
|
|||
->findOne($con)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all children of the given object identity.
|
||||
*
|
||||
* @param ObjectIdentity $objectIdentity
|
||||
* @param PropelPDO $con
|
||||
*
|
||||
* @return PropelCollection
|
||||
*/
|
||||
public function findChildren(ObjectIdentity $objectIdentity, PropelPDO $con = null)
|
||||
{
|
||||
return $this
|
||||
->filterByObjectIdentityRelatedByParentObjectIdentityId($objectIdentity)
|
||||
->find($con)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all children and grand-children of the given object identity.
|
||||
*
|
||||
* @param ObjectIdentity $objectIdentity
|
||||
* @param PropelPDO $con
|
||||
*
|
||||
* @return PropelCollection
|
||||
*/
|
||||
public function findGrandChildren(ObjectIdentity $objectIdentity, PropelPDO $con = null)
|
||||
{
|
||||
return $this
|
||||
->useObjectIdentityAncestorRelatedByObjectIdentityIdQuery()
|
||||
->filterByObjectIdentityRelatedByAncestorId($objectIdentity)
|
||||
->filterByObjectIdentityRelatedByObjectIdentityId($objectIdentity, Criteria::NOT_EQUAL)
|
||||
->endUse()
|
||||
->find($con)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue