class SocialDownloadCountConfigOverride in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8.2 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8.3 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8.4 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8.5 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8.6 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 8.7 modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 10.3.x modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 10.0.x modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 10.1.x modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
- 10.2.x modules/social_features/social_download_count/src/SocialDownloadCountConfigOverride.php \Drupal\social_download_count\SocialDownloadCountConfigOverride
Class SocialDownloadCountConfigOverride.
Example configuration override.
@package Drupal\social_download_count
Hierarchy
- class \Drupal\social_download_count\SocialDownloadCountConfigOverride implements ConfigFactoryOverrideInterface
Expanded class hierarchy of SocialDownloadCountConfigOverride
2 string references to 'SocialDownloadCountConfigOverride'
- SocialDownloadCountConfigOverride::getCacheSuffix in modules/
social_features/ social_download_count/ src/ SocialDownloadCountConfigOverride.php - The string to append to the configuration static cache name.
- social_download_count.services.yml in modules/
social_features/ social_download_count/ social_download_count.services.yml - modules/social_features/social_download_count/social_download_count.services.yml
1 service uses SocialDownloadCountConfigOverride
- social_download_count.overrider in modules/
social_features/ social_download_count/ social_download_count.services.yml - \Drupal\social_download_count\SocialDownloadCountConfigOverride
File
- modules/
social_features/ social_download_count/ src/ SocialDownloadCountConfigOverride.php, line 15
Namespace
Drupal\social_download_countView source
class SocialDownloadCountConfigOverride implements ConfigFactoryOverrideInterface {
/**
* Load overrides.
*/
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;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialDownloadCountConfigOverride';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata($name) {
return new CacheableMetadata();
}
/**
* {@inheritdoc}
*/
public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SocialDownloadCountConfigOverride:: |
public | function |
Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface:: |
|
SocialDownloadCountConfigOverride:: |
public | function |
Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface:: |
|
SocialDownloadCountConfigOverride:: |
public | function |
The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface:: |
|
SocialDownloadCountConfigOverride:: |
public | function |
Load overrides. Overrides ConfigFactoryOverrideInterface:: |