src/LinkResolver.php
private function resolveLinksForResourceType(string $type, array $links, string $locale = null): array
    {
        $resourceIds = \array_map(function (Link $link): string {
            return $link->getId();
        }, \array_filter($links, function (Link $link) use ($type): bool {
            return $link->getLinkType() === $type;
        }));

        $resources = [];
        $collection = $this->fetchResourcesForGivenIds($resourceIds, $type, $locale);
        foreach ($collection as $resource) {
            $resources[$type.'.'.$resource->getId()] = $resource;
        }

        return $resources;
    }
private function resolveLinksForResourceType(string $type, array $links, string $locale = null): array
    {
        $resourceIds = \array_map(function (Link $link): string {
            return $link->getId();
        }, \array_filter($links, function (Link $link) use ($type): bool {
            return $link->getLinkType() === $type;
        }));

        $resources = [];
        $collection = $this->fetchResourcesForGivenIds($resourceIds, $type, $locale);
        foreach ($collection as $resource) {
            $resources[$type.'.'.$resource->getId()] = $resource;
        }

        return $resources;
    }
private function resolveLinksForResourceType ( string $ type , array $ links , string $ locale = null ) : array { $ resourceIds = \ array_map ( function ( Link $ link ) : string { return $ link -> getId ( ) ; } , \ array_filter ( $ links , function ( Link $ link ) use ( $ type ) : bool { return $ link -> getLinkType ( ) === $ type ; } ) ) ; $ resources = [ ] ; $ collection = $ this -> fetchResourcesForGivenIds ( $ resourceIds , $ type , $ locale ) ; foreach ( $ collection as $ resource ) { $ resources [ $ type . '.' . $ resource -> getId ( ) ] = $ resource ; } return $ resources ; }
Loads resources for a certain type only.

@param string      $type
@param Link[]      $links
@param string|null $locale

@return ResourceInterface[]
Loads resources for a certain type only .