You are here

public function SocialFilePrivateFieldsConfigOverride::loadOverrides in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  2. 8 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  3. 8.2 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  4. 8.3 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  5. 8.4 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  6. 8.5 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  7. 8.6 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  8. 8.8 modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  9. 10.3.x modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  10. 10.0.x modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  11. 10.1.x modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::loadOverrides()
  12. 10.2.x modules/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php \Drupal\social_file_private\SocialFilePrivateFieldsConfigOverride::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/custom/social_file_private/src/SocialFilePrivateFieldsConfigOverride.php, line 53

Class

SocialFilePrivateFieldsConfigOverride
Class SocialFilePrivateFieldsConfigOverride.

Namespace

Drupal\social_file_private

Code

public function loadOverrides($names) {
  $overrides = [];
  if (PrivateStream::basePath()) {
    $config_names = $this
      ->getFileImageFieldsToProtect();
    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $config = \Drupal::service('config.factory')
          ->getEditable($config_name);
        $uri_scheme = $config
          ->get('settings.uri_scheme');
        if ($uri_scheme == 'public') {
          $overrides[$config_name]['settings']['uri_scheme'] = 'private';
        }
      }
    }
  }
  return $overrides;
}