You are here

public function ContentTranslationConfigOverrideBase::loadOverrides in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  2. 8.4 modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  3. 8.5 modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  4. 8.6 modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  5. 8.7 modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  6. 8.8 modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  7. 10.3.x modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  8. 10.0.x modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()
  9. 10.2.x modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php \Drupal\social_core\ContentTranslationConfigOverrideBase::loadOverrides()

Returns config overrides.

Parameters

array $names: A list of configuration names that are being loaded.

Return value

array An array keyed by configuration name of override data. Override data contains a nested array structure of overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/social_features/social_core/src/ContentTranslationConfigOverrideBase.php, line 54

Class

ContentTranslationConfigOverrideBase
Provides a base class for configurable content translation config overrides.

Namespace

Drupal\social_core

Code

public function loadOverrides($names) {
  $overrides = [];

  // This setting can't be changed in an override because that would create
  // and endless loop in trying to apply the override.
  $settings = \Drupal::configFactory()
    ->getEditable('social_content_translation.settings');
  $is_enabled = $settings
    ->getOriginal($this
    ->getModule(), FALSE);
  if ($is_enabled) {
    $translation_overrides = $this
      ->getTranslationOverrides();
    foreach ($translation_overrides as $name => $override) {
      if (in_array($name, $names)) {
        $overrides[$name] = $override;
      }
    }
  }
  return $overrides;
}