class SocialBookConfigOverride in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.2 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.3 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.4 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.5 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.6 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.7 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 8.8 modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 10.3.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 10.0.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 10.1.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
- 10.2.x modules/social_features/social_book/src/SocialBookConfigOverride.php \Drupal\social_book\SocialBookConfigOverride
Class SocialBookConfigOverride.
Example configuration override.
@package Drupal\social_book
Hierarchy
- class \Drupal\social_book\SocialBookConfigOverride implements ConfigFactoryOverrideInterface
Expanded class hierarchy of SocialBookConfigOverride
2 string references to 'SocialBookConfigOverride'
- SocialBookConfigOverride::getCacheSuffix in modules/
social_features/ social_book/ src/ SocialBookConfigOverride.php - The string to append to the configuration static cache name.
- social_book.services.yml in modules/
social_features/ social_book/ social_book.services.yml - modules/social_features/social_book/social_book.services.yml
1 service uses SocialBookConfigOverride
- social_book.overrider in modules/
social_features/ social_book/ social_book.services.yml - \Drupal\social_book\SocialBookConfigOverride
File
- modules/
social_features/ social_book/ src/ SocialBookConfigOverride.php, line 15
Namespace
Drupal\social_bookView source
class SocialBookConfigOverride implements ConfigFactoryOverrideInterface {
/**
* Load overrides.
*/
public function loadOverrides($names) {
$overrides = [];
// Set hero title block for book content type.
$config_names = [
'block.block.socialbase_pagetitleblock',
'block.block.socialblue_pagetitleblock',
];
foreach ($config_names as $config_name) {
if (in_array($config_name, $names)) {
$config = \Drupal::service('config.factory')
->getEditable($config_name);
$bundles = $config
->get('visibility.node_type.bundles');
$bundles['book'] = 'book';
$overrides[$config_name] = [
'visibility' => [
'node_type' => [
'bundles' => $bundles,
],
],
];
}
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialBookConfigOverride';
}
/**
* {@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 |
---|---|---|---|---|
SocialBookConfigOverride:: |
public | function |
Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface:: |
|
SocialBookConfigOverride:: |
public | function |
Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface:: |
|
SocialBookConfigOverride:: |
public | function |
The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface:: |
|
SocialBookConfigOverride:: |
public | function |
Load overrides. Overrides ConfigFactoryOverrideInterface:: |