summaryrefslogtreecommitdiffstats
path: root/Acl
diff options
context:
space:
mode:
Diffstat (limited to 'Acl')
-rw-r--r--Acl/Dbal/AclProvider.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/Acl/Dbal/AclProvider.php b/Acl/Dbal/AclProvider.php
index b53dc75..5074614 100644
--- a/Acl/Dbal/AclProvider.php
+++ b/Acl/Dbal/AclProvider.php
@@ -173,7 +173,8 @@ class AclProvider implements AclProviderInterface
}
// Is it time to load the current batch?
- if ((self::MAX_BATCH_SIZE === count($currentBatch) || ($i + 1) === $c) && count($currentBatch) > 0) {
+ $currentBatchesCount = count($currentBatch);
+ if ($currentBatchesCount > 0 && (self::MAX_BATCH_SIZE === $currentBatchesCount || ($i + 1) === $c)) {
try {
$loadedBatch = $this->lookupObjectIdentities($currentBatch, $sids, $oidLookup);
} catch (AclNotFoundException $aclNotFoundexception) {
@@ -557,10 +558,11 @@ QUERY;
// attach ACL to the result set; even though we do not enforce that every
// object identity has only one instance, we must make sure to maintain
// referential equality with the oids passed to findAcls()
- if (!isset($oidCache[$objectIdentifier.$classType])) {
- $oidCache[$objectIdentifier.$classType] = $acl->getObjectIdentity();
+ $oidCacheKey = $objectIdentifier.$classType;
+ if (!isset($oidCache[$oidCacheKey])) {
+ $oidCache[$oidCacheKey] = $acl->getObjectIdentity();
}
- $result->attach($oidCache[$objectIdentifier.$classType], $acl);
+ $result->attach($oidCache[$oidCacheKey], $acl);
// so, this hasn't been hydrated yet
} else {
// create object identity if we haven't done so yet
@@ -668,7 +670,7 @@ QUERY;
// let's see if we have already hydrated this
if (isset($acls[$parentId])) {
$aclParentAclProperty->setValue($acl, $acls[$parentId]);
- $processed += 1;
+ ++$processed;
continue;
}