You are here

public static function LinkSettingsTrait::supplementDefaultSettings in Simple XML sitemap 4.x

Supplements all missing link setting with default values.

Parameters

array|null &$settings:

array $overrides:

3 calls to LinkSettingsTrait::supplementDefaultSettings()
CustomLinkManager::get in src/Manager/CustomLinkManager.php
Gets custom link settings for the 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::setBundleSettings in src/Manager/EntityManager.php
Sets settings for bundle or non-bundle entity types. This is done for the currently set variant. Note that this method takes only the first set variant into account. See todo.

File

src/Manager/LinkSettingsTrait.php, line 16

Class

LinkSettingsTrait
Trait LinkSettingsTrait

Namespace

Drupal\simple_sitemap\Manager

Code

public static function supplementDefaultSettings(&$settings, array $overrides = []) : void {
  foreach (self::$linkSettingDefaults as $setting => $value) {
    if (!isset($settings[$setting])) {
      $settings[$setting] = $overrides[$setting] ?? $value;
    }
  }
}