src/Sulu/Bundle/MarkupBundle/Markup/LinkTag.php
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;
    }
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;
    }
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 ; }
Return items for given attributes.

@param array $attributesByTag
@param string $locale
@param bool $published

@return LinkItem[]
Return items for given attributes .