You are here

protected function UrlGeneratorBase::getAlternateUrlsForDefaultLanguage in Simple XML sitemap 8.2

1 call to UrlGeneratorBase::getAlternateUrlsForDefaultLanguage()
UrlGeneratorBase::addUrlVariants in src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php

File

src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php, line 258

Class

UrlGeneratorBase
Class UrlGeneratorBase @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

protected function getAlternateUrlsForDefaultLanguage($url_object) {
  $alternate_urls = [];
  if ($url_object
    ->access($this->anonUser)) {
    $url_object
      ->setOption('language', $this->languages[$this->defaultLanguageId]);
    $alternate_urls[$this->defaultLanguageId] = $this
      ->replaceBaseUrlWithCustom($url_object
      ->toString());
  }
  return $alternate_urls;
}