Sulu\Bundle\ContentBundle\Markup\LinkTag::preload PHP Метод

preload() приватный Метод

Return items for given attributes.
private preload ( array $attributesByTag, string $locale, boolean $published = true ) : LinkItem[]
$attributesByTag array
$locale string
$published boolean
Результат Sulu\Bundle\ContentBundle\Markup\Link\LinkItem[]
    private function preload($attributesByTag, $locale, $published = true)
    {
        $hrefsByType = [];
        foreach ($attributesByTag as $attributes) {
            $provider = $this->getValue($attributes, 'provider', self::DEFAULT_PROVIDER);
            if (!array_key_exists($provider, $hrefsByType)) {
                $hrefsByType[$provider] = [];
            }
            $hrefsByType[$provider][] = $attributes['href'];
        }
        $result = [];
        foreach ($hrefsByType as $provider => $hrefs) {
            $items = $this->linkProviderPool->getProvider($provider)->preload(array_unique($hrefs), $locale, $published);
            foreach ($items as $item) {
                $result[$provider . '-' . $item->getId()] = $item;
            }
        }
        return $result;
    }