class MenuLinkConfigMapper in Config menu link 8
Provides configuration mapper for configuration menu links.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\config_translation\ConfigNamesMapper implements ConfigMapperInterface, ContainerFactoryPluginInterface
- class \Drupal\config_translation\ConfigEntityMapper uses DeprecatedServicePropertyTrait
- class \Drupal\menu_link_config\MenuLinkConfigMapper
- class \Drupal\config_translation\ConfigEntityMapper uses DeprecatedServicePropertyTrait
- class \Drupal\config_translation\ConfigNamesMapper implements ConfigMapperInterface, ContainerFactoryPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of MenuLinkConfigMapper
File
- src/
MenuLinkConfigMapper.php, line 16 - Contains \Drupal\menu_link_config\MenuLinkConfigMapper.
Namespace
Drupal\menu_link_configView source
class MenuLinkConfigMapper extends ConfigEntityMapper {
/**
* {@inheritdoc}
*/
public function getBaseRouteParameters() {
return [
'menu_link_plugin' => 'menu_link_config:' . $this->entity
->id(),
'menu_link_config' => $this->entity
->id(),
];
}
/**
* {@inheritdoc}
*/
public function populateFromRequest(Request $request) {
// We cannot call the parent implementation because the request does not
// have a 'menu_link_config' attribute, so we have to duplicate
// ConfigNamesMapper::populateFromRequest() here.
if ($request->attributes
->has('langcode')) {
$this->langcode = $request->attributes
->get('langcode');
}
else {
$this->langcode = NULL;
}
/** @var \Drupal\menu_link_config\Plugin\Menu\MenuLinkConfig $plugin */
$plugin = $request->attributes
->get('menu_link_plugin');
$this
->setEntity($plugin
->getEntity());
}
/**
* {@inheritdoc}
*/
protected function processRoute(Route $route) {
// Add entity upcasting information.
$parameters = $route
->getOption('parameters') ?: array();
$parameters += array(
'menu_link_plugin' => array(
'type' => 'menu_link_plugin',
),
);
$route
->setOption('parameters', $parameters);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigEntityMapper:: |
protected | property | ||
ConfigEntityMapper:: |
protected | property | Loaded entity instance to help produce the translation interface. | 1 |
ConfigEntityMapper:: |
protected | property | Configuration entity type name. | |
ConfigEntityMapper:: |
protected | property | The entity manager. | |
ConfigEntityMapper:: |
protected | property | The label for the entity type. | |
ConfigEntityMapper:: |
public static | function |
Creates an instance of the plugin. Overrides ConfigNamesMapper:: |
|
ConfigEntityMapper:: |
public | function |
Returns the name of the contextual link group to add contextual links to. Overrides ConfigNamesMapper:: |
|
ConfigEntityMapper:: |
public | function | Gets the entity instance for this mapper. | |
ConfigEntityMapper:: |
public | function |
Provides an array of information to build a list of operation links. Overrides ConfigNamesMapper:: |
|
ConfigEntityMapper:: |
public | function |
Returns route name for the translation overview route. Overrides ConfigNamesMapper:: |
1 |
ConfigEntityMapper:: |
public | function |
Returns title of this translation page. Overrides ConfigNamesMapper:: |
|
ConfigEntityMapper:: |
public | function | Gets the entity type from this mapper. | |
ConfigEntityMapper:: |
public | function |
Returns the label of the type of data the mapper encapsulates. Overrides ConfigNamesMapper:: |
1 |
ConfigEntityMapper:: |
public | function |
Returns the name of the type of data the mapper encapsulates. Overrides ConfigNamesMapper:: |
|
ConfigEntityMapper:: |
public | function |
Populate the config mapper with route match data. Overrides ConfigNamesMapper:: |
|
ConfigEntityMapper:: |
public | function | Sets the entity instance for this mapper. | 2 |
ConfigEntityMapper:: |
public | function | Set entity type for this mapper. | |
ConfigEntityMapper:: |
public | function |
Constructs a ConfigEntityMapper. Overrides ConfigNamesMapper:: |
|
ConfigNamesMapper:: |
protected | property | The base route object that the mapper is attached to. | |
ConfigNamesMapper:: |
protected | property | The configuration factory. | |
ConfigNamesMapper:: |
protected | property | The mapper plugin discovery service. | |
ConfigNamesMapper:: |
protected | property | The event dispatcher. | |
ConfigNamesMapper:: |
protected | property | The language code of the language this mapper, if any. | |
ConfigNamesMapper:: |
protected | property | The language manager. | |
ConfigNamesMapper:: |
protected | property | The typed configuration manager. | |
ConfigNamesMapper:: |
protected | property | The available routes. | |
ConfigNamesMapper:: |
protected | property | The route provider. | |
ConfigNamesMapper:: |
protected | property | The typed config manager. | |
ConfigNamesMapper:: |
public | function |
Adds the given configuration name to the list of names. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route object for a translation add form route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns route name for the translation add form route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route parameters for the translation add form route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns a processed path for the base route the mapper is attached to. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the base route object the mapper is attached to. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the name of the base route the mapper is attached to. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns an array with all configuration data. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns an array of configuration names for the mapper. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route object for the translation deletion route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns route name for the translation deletion route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route parameters for the translation deletion route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route object for a translation edit form route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns route name for the translation edit form route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route parameters for the translation edit form route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the original language code of the configuration. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the language code of a configuration object given its name. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns a processed path for the translation overview route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route object for a translation overview route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the route parameters for the translation overview route. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Returns the weight of the mapper. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Checks that all pieces of this configuration mapper have a schema. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Checks if pieces of this configuration mapper have translatables. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Checks whether there is already a translation for this mapper. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Sets the original language code. Overrides ConfigMapperInterface:: |
|
ConfigNamesMapper:: |
public | function |
Sets the route collection. Overrides ConfigMapperInterface:: |
|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
MenuLinkConfigMapper:: |
public | function |
Returns the route parameters for the base route the mapper is attached to. Overrides ConfigEntityMapper:: |
|
MenuLinkConfigMapper:: |
public | function | ||
MenuLinkConfigMapper:: |
protected | function |
Allows to process all config translation routes. Overrides ConfigEntityMapper:: |
|
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |