LanguageConfigFactoryOverride
class LanguageConfigFactoryOverride extends ConfigFactoryOverrideBase implements LanguageConfigFactoryOverrideInterface, EventSubscriberInterface (View source)
Provides language overrides for the configuration factory.
Traits
Provides a common trait for working with language override collection names.
Properties
| protected StorageInterface | $baseStorage | The configuration storage. |
|
| protected StorageInterface[] | $storages | An array of configuration storages keyed by langcode. |
|
| protected TypedConfigManagerInterface | $typedConfigManager | The typed config manager. |
|
| protected EventDispatcherInterface | $eventDispatcher | An event dispatcher instance to use for configuration events. |
|
| protected LanguageInterface | $language | The language object used to override configuration data. |
Methods
Reacts to the ConfigEvents::COLLECTION_INFO event.
Actions to be performed to configuration override on configuration save.
Actions to be performed to configuration override on configuration delete.
Actions to be performed to configuration override on configuration rename.
Filters data in the override based on what is currently in configuration.
Filters data in nested arrays.
Creates a configuration collection name based on a language code.
Converts a configuration collection name to a language code.
Constructs the LanguageConfigFactoryOverride object.
Returns config overrides.
Get language override for given language and configuration name.
Returns the storage instance for a particular langcode.
The string to append to the configuration static cache name.
Gets the language object used to override configuration data.
Sets the language to be used in configuration overrides.
Sets the language to be used in configuration overrides from the default.
Installs available language configuration overrides for a given langcode.
Creates a configuration object for use during install and synchronization.
Gets the cacheability metadata associated with the config factory override.
Details
addCollections(ConfigCollectionInfo $collection_info)
Reacts to the ConfigEvents::COLLECTION_INFO event.
onConfigSave(ConfigCrudEvent $event)
Actions to be performed to configuration override on configuration save.
onConfigDelete(ConfigCrudEvent $event)
Actions to be performed to configuration override on configuration delete.
onConfigRename(ConfigRenameEvent $event)
Actions to be performed to configuration override on configuration rename.
static
getSubscribedEvents()
{@inheritdoc}
protected
filterOverride(Config $config, StorableConfigBase $override)
Filters data in the override based on what is currently in configuration.
protected bool
filterNestedArray(array $original_data, array $override_data)
Filters data in nested arrays.
protected string
createConfigCollectionName(string $langcode)
Creates a configuration collection name based on a language code.
protected string
getLangcodeFromCollectionName(string $collection)
Converts a configuration collection name to a language code.
__construct(StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config, LanguageDefault $default_language)
Constructs the LanguageConfigFactoryOverride object.
array
loadOverrides(array $names)
Returns config overrides.
Config
getOverride(string $langcode, string $name)
Get language override for given language and configuration name.
StorageInterface
getStorage(string $langcode)
Returns the storage instance for a particular langcode.
string
getCacheSuffix()
The string to append to the configuration static cache name.
LanguageInterface
getLanguage()
Gets the language object used to override configuration data.
$this
setLanguage(LanguageInterface $language = NULL)
Sets the language to be used in configuration overrides.
$this
setLanguageFromDefault(LanguageDefault $language_default = NULL)
Sets the language to be used in configuration overrides from the default.
installLanguageOverrides(string $langcode)
Installs available language configuration overrides for a given langcode.
StorableConfigBase
createConfigObject(string $name, string $collection = StorageInterface::DEFAULT_COLLECTION)
Creates a configuration object for use during install and synchronization.
If the overrider stores its overrides in configuration collections then it can have its own implementation of \Drupal\Core\Config\StorableConfigBase. Configuration overriders can link themselves to a configuration collection by listening to the \Drupal\Core\Config\ConfigEvents::COLLECTION_INFO event and adding the collections they are responsible for. Doing this will allow installation and synchronization to use the overrider's implementation of StorableConfigBase.
CacheableMetadata
getCacheableMetadata(string $name)
Gets the cacheability metadata associated with the config factory override.