You are here

protected function VariantSetterTrait::getVariants in Simple XML sitemap 4.x

Gets the currently set variants, the default variant, or all variants.

Parameters

bool $default_get_all: If true and no variants are set, all variants are returned. If false and no variants are set, only the default variant is returned.

Return value

array

14 calls to VariantSetterTrait::getVariants()
CustomLinkManager::add in src/Manager/CustomLinkManager.php
Stores a custom path along with its settings to configuration for the currently set variants.
CustomLinkManager::get in src/Manager/CustomLinkManager.php
Gets custom link settings for the currently set variants.
CustomLinkManager::remove in src/Manager/CustomLinkManager.php
Removes custom links from currently set variants.
EntityManager::getBundleSettings in src/Manager/EntityManager.php
Gets settings for bundle or non-bundle entity types. This is done for the currently set variants.
EntityManager::getEntityInstanceSettings in src/Manager/EntityManager.php
Gets sitemap settings for an entity instance which overrides bundle settings, or gets bundle settings, if they are not overridden. This is done for the currently set variant. Please note, this method takes only the first set variant into account. See…

... See full list

File

src/Manager/VariantSetterTrait.php, line 50

Class

VariantSetterTrait
Class Simplesitemap

Namespace

Drupal\simple_sitemap\Manager

Code

protected function getVariants(bool $default_get_all = TRUE) : array {
  if (NULL === $this->variants) {
    $this
      ->setVariants($default_get_all ? TRUE : NULL);
  }
  return $this->variants;
}