You are here

public static function Simplesitemap::supplementDefaultSettings in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 8.2 src/Simplesitemap.php \Drupal\simple_sitemap\Simplesitemap::supplementDefaultSettings()

Supplements all missing link setting with default values.

Parameters

string $type: Can be 'entity' or 'custom'.

array &$settings:

array $overrides:

3 calls to Simplesitemap::supplementDefaultSettings()
Simplesitemap::getBundleSettings in src/Simplesitemap.php
Gets settings for bundle or non-bundle entity types. This is done for the currently set variants.
Simplesitemap::getCustomLinks in src/Simplesitemap.php
Gets custom link settings for the currently set variants.
Simplesitemap::setBundleSettings in src/Simplesitemap.php
Sets settings for bundle or non-bundle entity types. This is done for the currently set variant.

File

src/Simplesitemap.php, line 667

Class

Simplesitemap
Class Simplesitemap @package Drupal\simple_sitemap

Namespace

Drupal\simple_sitemap

Code

public static function supplementDefaultSettings($type, &$settings, $overrides = []) {
  foreach (self::$allowedLinkSettings[$type] as $allowed_link_setting) {
    if (!isset($settings[$allowed_link_setting]) && isset(self::$linkSettingDefaults[$allowed_link_setting])) {
      $settings[$allowed_link_setting] = isset($overrides[$allowed_link_setting]) ? $overrides[$allowed_link_setting] : self::$linkSettingDefaults[$allowed_link_setting];
    }
  }
}