StaticMenuLinkOverrides
class StaticMenuLinkOverrides implements StaticMenuLinkOverridesInterface (View source)
Defines an implementation of the menu link override using a config file.
Properties
| protected string | $configName | The config name used to store the overrides. |
|
| protected Config | $config | The menu link overrides config object. |
|
| protected ConfigFactoryInterface | $configFactory | The config factory object. |
Methods
Gets the configuration object when needed.
Reloads the overrides from config.
Loads any overrides to the definition of a static (YAML-defined) link.
Deletes multiple overrides to definitions of static (YAML-defined) links.
Deletes any overrides to the definition of a static (YAML-defined) link.
Loads overrides to multiple definitions of a static (YAML-defined) link.
Saves the override.
The unique cache tag associated with this menu link override.
Encodes the ID by replacing dots with double underscores.
Details
__construct(ConfigFactoryInterface $config_factory)
Constructs a StaticMenuLinkOverrides object.
protected
getConfig()
Gets the configuration object when needed.
Since this service is injected into all static menu link objects, but only used when updating one, avoid actually loading the config when it's not needed.
reload()
Reloads the overrides from config.
Forces all overrides to be reloaded from config storage to compare the override value with the value submitted during test form submission.
array|null
loadOverride(string $id)
Loads any overrides to the definition of a static (YAML-defined) link.
deleteMultipleOverrides(array $ids)
Deletes multiple overrides to definitions of static (YAML-defined) links.
deleteOverride(string $id)
Deletes any overrides to the definition of a static (YAML-defined) link.
array
loadMultipleOverrides(array $ids)
Loads overrides to multiple definitions of a static (YAML-defined) link.
array
saveOverride(string $id, array $definition)
Saves the override.
string[]
getCacheTags()
The unique cache tag associated with this menu link override.
static protected string
encodeId(string $id)
Encodes the ID by replacing dots with double underscores.
This is done because config schema uses dots for its internal type hierarchy. Double underscores are converted to triple underscores to avoid accidental conflicts.