pass PDO connection to all methods within ACL

This commit is contained in:
Toni Uebernickel 2012-01-31 17:39:03 +01:00
commit 4b6001c6fe
5 changed files with 8 additions and 7 deletions

View file

@ -25,16 +25,17 @@ class ObjectIdentityQuery extends BaseObjectIdentityQuery
* Filter by an ObjectIdentity object belonging to the given ACL related ObjectIdentity.
*
* @param ObjectIdentityInterface $objectIdentity
* @param PropelPDO $con
*
* @return ObjectIdentityQuery $this
*/
public function filterByAclObjectIdentity(ObjectIdentityInterface $objectIdentity)
public function filterByAclObjectIdentity(ObjectIdentityInterface $objectIdentity, PropelPDO $con = null)
{
/*
* Not using a JOIN here, because the filter may be applied on 'findOneOrCreate',
* which is currently (Propel 1.6.4-dev) not working.
*/
$aclClass = AclClass::fromAclObjectIdentity($objectIdentity);
$aclClass = AclClass::fromAclObjectIdentity($objectIdentity, $con);
$this
->filterByClassId($aclClass->getId())
->filterByIdentifier($objectIdentity->getIdentifier())
@ -54,7 +55,7 @@ class ObjectIdentityQuery extends BaseObjectIdentityQuery
public function findOneByAclObjectIdentity(ObjectIdentityInterface $objectIdentity, PropelPDO $con = null)
{
return $this
->filterByAclObjectIdentity($objectIdentity)
->filterByAclObjectIdentity($objectIdentity, $con)
->findOne($con)
;
}