Sitemap/ArticleSitemapProvider.php
private function setAlternatives(array $sitemapUrlList, SitemapUrl $sitemapUrl)
    {
        foreach ($sitemapUrlList as $sitemapUrlFromList) {
            // Add current as alternative to exist.
            $sitemapUrlFromList->addAlternateLink(
                new SitemapAlternateLink($sitemapUrl->getLoc(), $sitemapUrl->getLocale())
            );

            // Add others as alternative to current.
            $sitemapUrl->addAlternateLink(
                new SitemapAlternateLink($sitemapUrlFromList->getLoc(), $sitemapUrlFromList->getLocale())
            );
        }

        $sitemapUrlList[] = $sitemapUrl;

        return $sitemapUrlList;
    }
private function setAlternatives(array $sitemapUrlList, SitemapUrl $sitemapUrl)
    {
        foreach ($sitemapUrlList as $sitemapUrlFromList) {
            // Add current as alternative to exist.
            $sitemapUrlFromList->addAlternateLink(
                new SitemapAlternateLink($sitemapUrl->getLoc(), $sitemapUrl->getLocale())
            );

            // Add others as alternative to current.
            $sitemapUrl->addAlternateLink(
                new SitemapAlternateLink($sitemapUrlFromList->getLoc(), $sitemapUrlFromList->getLocale())
            );
        }

        $sitemapUrlList[] = $sitemapUrl;

        return $sitemapUrlList;
    }
private function setAlternatives ( array $ sitemapUrlList , SitemapUrl $ sitemapUrl ) { foreach ( $ sitemapUrlList as $ sitemapUrlFromList ) { // Add current as alternative to exist. $ sitemapUrlFromList -> addAlternateLink ( new SitemapAlternateLink ( $ sitemapUrl -> getLoc ( ) , $ sitemapUrl -> getLocale ( ) ) ) ; // Add others as alternative to current. $ sitemapUrl -> addAlternateLink ( new SitemapAlternateLink ( $ sitemapUrlFromList -> getLoc ( ) , $ sitemapUrlFromList -> getLocale ( ) ) ) ; } $ sitemapUrlList [ ] = $ sitemapUrl ; return $ sitemapUrlList ; }
Set alternatives to sitemap url.

@param SitemapUrl[] $sitemapUrlList
@param SitemapUrl $sitemapUrl

@return SitemapUrl[]
Set alternatives to sitemap url .