class SocialFollowTagOverrides in Open Social 10.1.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/SocialFollowTagOverrides.php \Drupal\social_follow_tag\SocialFollowTagOverrides
- 10.0.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/SocialFollowTagOverrides.php \Drupal\social_follow_tag\SocialFollowTagOverrides
- 10.2.x modules/social_features/social_follow_taxonomy/modules/social_follow_tag/src/SocialFollowTagOverrides.php \Drupal\social_follow_tag\SocialFollowTagOverrides
Provide config overrides for the 'social_follow_tag' module.
@package Drupal\social_follow_tag
Hierarchy
- class \Drupal\social_follow_tag\SocialFollowTagOverrides implements ConfigFactoryOverrideInterface
Expanded class hierarchy of SocialFollowTagOverrides
2 string references to 'SocialFollowTagOverrides'
- SocialFollowTagOverrides::getCacheSuffix in modules/
social_features/ social_follow_taxonomy/ modules/ social_follow_tag/ src/ SocialFollowTagOverrides.php - The string to append to the configuration static cache name.
- social_follow_tag.services.yml in modules/
social_features/ social_follow_taxonomy/ modules/ social_follow_tag/ social_follow_tag.services.yml - modules/social_features/social_follow_taxonomy/modules/social_follow_tag/social_follow_tag.services.yml
1 service uses SocialFollowTagOverrides
- social_follow_tag.overrider in modules/
social_features/ social_follow_taxonomy/ modules/ social_follow_tag/ social_follow_tag.services.yml - Drupal\social_follow_tag\SocialFollowTagOverrides
File
- modules/
social_features/ social_follow_taxonomy/ modules/ social_follow_tag/ src/ SocialFollowTagOverrides.php, line 15
Namespace
Drupal\social_follow_tagView source
class SocialFollowTagOverrides implements ConfigFactoryOverrideInterface {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs the configuration override.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The Drupal configuration factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public function loadOverrides($names) {
$overrides = [];
// Add social_tagging taxonomy bundle to follow_term flag config.
$config_name = 'flag.flag.follow_term';
$config = $this->configFactory
->getEditable($config_name);
$bundles = $config
->get('bundles');
if (!empty($bundles) && !in_array('social_tagging', $bundles)) {
array_push($bundles, 'social_tagging');
if (in_array($config_name, $names)) {
$overrides[$config_name] = [
'bundles' => $bundles,
];
}
}
return $overrides;
}
/**
* {@inheritdoc}
*/
public function getCacheSuffix() {
return 'SocialFollowTagOverrides';
}
/**
* {@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 |
---|---|---|---|---|
SocialFollowTagOverrides:: |
protected | property | The config factory. | |
SocialFollowTagOverrides:: |
public | function |
Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface:: |
|
SocialFollowTagOverrides:: |
public | function |
Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface:: |
|
SocialFollowTagOverrides:: |
public | function |
The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface:: |
|
SocialFollowTagOverrides:: |
public | function |
Returns config overrides. Overrides ConfigFactoryOverrideInterface:: |
|
SocialFollowTagOverrides:: |
public | function | Constructs the configuration override. |