You are here

public function SocialDownloadCountConfigOverride::loadOverrides in Open Social 8.3

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

Load overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php, line 20

Class

SocialDownloadCountConfigOverride
Class SocialDownloadCountConfigOverride.

Namespace

Drupal\social_download_count

Code

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

  // Set private file system to files field.
  $config_name = 'field.storage.node.field_files';
  if (in_array($config_name, $names)) {
    $overrides[$config_name] = [
      'settings' => [
        'uri_scheme' => 'private',
      ],
    ];
  }

  // Set download count widget to files fields.
  $content_types = [
    'book',
    'event',
    'page',
    'topic',
  ];
  foreach ($content_types as $content_type) {
    $config_name = "core.entity_view_display.node.{$content_type}.default";
    $overrides[$config_name] = [
      'content' => [
        'field_files' => [
          'type' => 'FieldDownloadCount',
        ],
      ],
    ];
  }
  return $overrides;
}