protected function UrlGeneratorBase::getAlternateUrlsForTranslatedLanguages in Simple XML sitemap 8.2
1 call to UrlGeneratorBase::getAlternateUrlsForTranslatedLanguages()
- UrlGeneratorBase::addUrlVariants in src/
Plugin/ simple_sitemap/ UrlGenerator/ UrlGeneratorBase.php
File
- src/
Plugin/ simple_sitemap/ UrlGenerator/ UrlGeneratorBase.php, line 267
Class
- UrlGeneratorBase
- Class UrlGeneratorBase @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator
Namespace
Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGeneratorCode
protected function getAlternateUrlsForTranslatedLanguages($entity, $url_object) {
$alternate_urls = [];
foreach ($entity
->getTranslationLanguages() as $language) {
if (!isset($this->batchSettings['excluded_languages'][$language
->getId()]) || $language
->isDefault()) {
$translation = $entity
->getTranslation($language
->getId());
if ($translation
->access('view', $this->anonUser)) {
$url_object
->setOption('language', $language);
$alternate_urls[$language
->getId()] = $this
->replaceBaseUrlWithCustom($url_object
->toString());
}
}
}
return $alternate_urls;
}