public function loadAll(array $targets, array $subjects, Service $service): array
    {
        $acls = [];
        if ($this->delegate instanceof MultiStrategy) {
            $oids = array_merge($targets);
            foreach ($targets as $i => $target) {
                if (!($target instanceof Target)) {
                    throw new \InvalidArgumentException("Only instances of Target are permitted in the targets argument");
                }
                $key = $this->buildKey($target, $subjects);
                if (isset($this->cache[$key])) {
                    $acls[(string)$target] = $this->cache[$key];
                    unset($oids[$i]);
                }
            }
            if (!empty($oids)) {
                $a = $this->delegate->loadAll($oids, $subjects, $service);
                foreach ($a as $acl) {
                    $key = $this->buildKey($acl->getTarget(), $subjects);
                    $this->cache[$key] = $acl;
                    $acls[(string)$acl->getTarget()] = $acl;
                }
            }
        } else {
            foreach ($targets as $target) {
                if (!($target instanceof Target)) {
                    throw new \InvalidArgumentException("Only instances of Target are permitted in the targets argument");
                }
                $acls[(string) $target] = $this->load($target, $subjects, $service);
            }
        }
        return $acls;
    }
public function loadAll(array $targets, array $subjects, Service $service): array
    {
        $acls = [];
        if ($this->delegate instanceof MultiStrategy) {
            $oids = array_merge($targets);
            foreach ($targets as $i => $target) {
                if (!($target instanceof Target)) {
                    throw new \InvalidArgumentException("Only instances of Target are permitted in the targets argument");
                }
                $key = $this->buildKey($target, $subjects);
                if (isset($this->cache[$key])) {
                    $acls[(string)$target] = $this->cache[$key];
                    unset($oids[$i]);
                }
            }
            if (!empty($oids)) {
                $a = $this->delegate->loadAll($oids, $subjects, $service);
                foreach ($a as $acl) {
                    $key = $this->buildKey($acl->getTarget(), $subjects);
                    $this->cache[$key] = $acl;
                    $acls[(string)$acl->getTarget()] = $acl;
                }
            }
        } else {
            foreach ($targets as $target) {
                if (!($target instanceof Target)) {
                    throw new \InvalidArgumentException("Only instances of Target are permitted in the targets argument");
                }
                $acls[(string) $target] = $this->load($target, $subjects, $service);
            }
        }
        return $acls;
    }
public function loadAll ( array $ targets , array $ subjects , Service $ service ) : array { $ acls = [ ] ; if ( $ this -> delegate instanceof MultiStrategy ) { $ oids = array_merge ( $ targets ) ; foreach ( $ targets as $ i => $ target ) { if ( ! ( $ target instanceof Target ) ) { throw new \ InvalidArgumentException ( "Only instances of Target are permitted in the targets argument" ) ; } $ key = $ this -> buildKey ( $ target , $ subjects ) ; if ( isset ( $ this -> cache [ $ key ] ) ) { $ acls [ ( string ) $ target ] = $ this -> cache [ $ key ] ; unset ( $ oids [ $ i ] ) ; } } if ( ! empty ( $ oids ) ) { $ a = $ this -> delegate -> loadAll ( $ oids , $ subjects , $ service ) ; foreach ( $ a as $ acl ) { $ key = $ this -> buildKey ( $ acl -> getTarget ( ) , $ subjects ) ; $ this -> cache [ $ key ] = $ acl ; $ acls [ ( string ) $ acl -> getTarget ( ) ] = $ acl ; } } } else { foreach ( $ targets as $ target ) { if ( ! ( $ target instanceof Target ) ) { throw new \ InvalidArgumentException ( "Only instances of Target are permitted in the targets argument" ) ; } $ acls [ ( string ) $ target ] = $ this -> load ( $ target , $ subjects , $ service ) ; } } return $ acls ; }
Loads the ACLs for several Targets.

@since 2.1.0
@param \Caridea\Acl\Target[] $targets The `Target` whose ACL will be loaded
@param \Caridea\Acl\Subject[] $subjects An array of `Subject`s
@param \Caridea\Acl\Service $service The ACL service (to load parent ACLs)
@return array<string,\Caridea\Acl\Acl> The loaded ACLs
@throws \Caridea\Acl\Exception\Unloadable If the target provided is invalid
@throws \InvalidArgumentException If the `subjects` argument contains invalid values
Loads the ACLs for several Targets .