public function cache($collection, array $tokens = array())
    {
        $sids = array();
        foreach ($tokens as $token) {
            $sids = array_merge($sids, $this->securityIdentityRetrievalStrategy->getSecurityIdentities($token));
        }

        $oids = array();
        foreach ($collection as $domainObject) {
            $oids[] = $this->objectIdentityRetrievalStrategy->getObjectIdentity($domainObject);
        }

        $this->aclProvider->findAcls($oids, $sids);
    }
public function cache($collection, array $tokens = array())
    {
        $sids = array();
        foreach ($tokens as $token) {
            $sids = array_merge($sids, $this->securityIdentityRetrievalStrategy->getSecurityIdentities($token));
        }

        $oids = array();
        foreach ($collection as $domainObject) {
            $oids[] = $this->objectIdentityRetrievalStrategy->getObjectIdentity($domainObject);
        }

        $this->aclProvider->findAcls($oids, $sids);
    }
public function cache ( $ collection , array $ tokens = array ( ) ) { $ sids = array ( ) ; foreach ( $ tokens as $ token ) { $ sids = array_merge ( $ sids , $ this -> securityIdentityRetrievalStrategy -> getSecurityIdentities ( $ token ) ) ; } $ oids = array ( ) ; foreach ( $ collection as $ domainObject ) { $ oids [ ] = $ this -> objectIdentityRetrievalStrategy -> getObjectIdentity ( $ domainObject ) ; } $ this -> aclProvider -> findAcls ( $ oids , $ sids ) ; }
Batch loads ACLs for an entire collection; thus, it reduces the number
of required queries considerably.

@param mixed            $collection anything that can be passed to foreach()
@param TokenInterface[] $tokens     an array of TokenInterface implementations
Batch loads ACLs for an entire collection ; thus it reduces the number of required queries considerably .