Drupal 8  8.0.2
ConfigNamesMapper Class Reference
Inheritance diagram for ConfigNamesMapper:

Public Member Functions

 __construct ($plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config, LocaleConfigManager $locale_config_manager, ConfigMapperManagerInterface $config_mapper_manager, RouteProviderInterface $route_provider, TranslationInterface $string_translation, LanguageManagerInterface $language_manager)
 
 setRouteCollection (RouteCollection $collection)
 
 getTitle ()
 
 getBaseRouteName ()
 
 getBaseRouteParameters ()
 
 getBaseRoute ()
 
 getBasePath ()
 
 getOverviewRouteName ()
 
 getOverviewRouteParameters ()
 
 getOverviewRoute ()
 
 getOverviewPath ()
 
 getAddRouteName ()
 
 getAddRouteParameters ()
 
 getAddRoute ()
 
 getEditRouteName ()
 
 getEditRouteParameters ()
 
 getEditRoute ()
 
 getDeleteRouteName ()
 
 getDeleteRouteParameters ()
 
 getDeleteRoute ()
 
 getConfigNames ()
 
 addConfigName ($name)
 
 getWeight ()
 
 populateFromRouteMatch (RouteMatchInterface $route_match)
 
 getTypeLabel ()
 
 getLangcode ()
 
 setLangcode ($langcode)
 
 getConfigData ()
 
 hasSchema ()
 
 hasTranslatable ()
 
 hasTranslation (LanguageInterface $language)
 
 getTypeName ()
 
 getOperations ()
 
 getContextualLinkGroup ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 processRoute (Route $route)
 

Protected Attributes

 $configFactory
 
 $typedConfigManager
 
 $localeConfigManager
 
 $configMapperManager
 
 $routeProvider
 
 $baseRoute
 
 $routeCollection
 
 $langcode = NULL
 
 $languageManager
 

Detailed Description

Configuration mapper base implementation.

Constructor & Destructor Documentation

__construct (   $plugin_id,
  $plugin_definition,
ConfigFactoryInterface  $config_factory,
TypedConfigManagerInterface  $typed_config,
LocaleConfigManager  $locale_config_manager,
ConfigMapperManagerInterface  $config_mapper_manager,
RouteProviderInterface  $route_provider,
TranslationInterface  $string_translation,
LanguageManagerInterface  $language_manager 
)

Constructs a ConfigNamesMapper.

Parameters
$plugin_idThe config mapper plugin ID.
mixed$plugin_definitionAn array of plugin information with the following keys:
  • title: The title of the mapper, used for generating page titles.
  • base_route_name: The route name of the base route this mapper is attached to.
  • names: (optional) An array of configuration names.
  • weight: (optional) The weight of this mapper, used in mapper listings. Defaults to 20.
  • list_controller: (optional) Class name for list controller used to generate lists of this type of configuration.
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe configuration factory.
\Drupal\Core\Config\TypedConfigManagerInterface$typed_configThe typed configuration manager.
\Drupal\locale\LocaleConfigManager$locale_config_managerThe locale configuration manager.
\Drupal\config_translation\ConfigMapperManagerInterface$config_mapper_managerThe mapper plugin discovery service.
\Drupal\Core\Routing\RouteProviderInterfaceThe route provider.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationThe string translation manager.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.
Exceptions
\Symfony\Component\Routing\Exception\RouteNotFoundExceptionThrows an exception if the route specified by the 'base_route_name' in the plugin definition could not be found by the route provider.

References Drupal\configFactory(), and Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

addConfigName (   $name)

{Adds the given configuration name to the list of names.Note that it is the responsibility of the calling code to ensure that the configuration exists.

Parameters
string$nameConfiguration name.
}

Implements ConfigMapperInterface.

Referenced by NodeTypeMapper\setEntity().

Here is the caller graph for this function:

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

getAddRoute ( )

{Returns the route object for a translation add form route.

Returns
The route object for the translation page.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRoute(), and ConfigNamesMapper\processRoute().

Here is the call graph for this function:

getAddRouteName ( )

{Returns route name for the translation add form route.

Returns
string Route name for the mapper.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteName().

Here is the call graph for this function:

getAddRouteParameters ( )

{Returns the route parameters for the translation add form route.

Returns
array
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteParameters().

Referenced by ConfigNamesMapper\getDeleteRouteParameters(), and ConfigNamesMapper\getEditRouteParameters().

Here is the call graph for this function:

Here is the caller graph for this function:

getBasePath ( )

{Returns a processed path for the base route the mapper is attached to.

Returns
string Processed path with placeholders replaced.
}

Implements ConfigMapperInterface.

References Url\fromRoute(), ConfigNamesMapper\getBaseRouteName(), and ConfigNamesMapper\getBaseRouteParameters().

Here is the call graph for this function:

getBaseRoute ( )

{Returns the base route object the mapper is attached to.

Returns
The base route object the mapper is attached to.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteName().

Referenced by ConfigNamesMapper\getAddRoute(), ConfigNamesMapper\getDeleteRoute(), ConfigNamesMapper\getEditRoute(), and ConfigNamesMapper\getOverviewRoute().

Here is the call graph for this function:

Here is the caller graph for this function:

getBaseRouteName ( )

{Returns the name of the base route the mapper is attached to.

Returns
string The name of the base route the mapper is attached to.
}

Implements ConfigMapperInterface.

Referenced by ConfigNamesMapper\getAddRouteName(), ConfigNamesMapper\getBasePath(), ConfigNamesMapper\getBaseRoute(), ConfigNamesMapper\getDeleteRouteName(), ConfigNamesMapper\getEditRouteName(), and ConfigNamesMapper\getOverviewRouteName().

Here is the caller graph for this function:

getBaseRouteParameters ( )

{Returns the route parameters for the base route the mapper is attached to.

Returns
array
}

Implements ConfigMapperInterface.

Referenced by ConfigNamesMapper\getAddRouteParameters(), ConfigNamesMapper\getBasePath(), and ConfigNamesMapper\getOverviewRouteParameters().

Here is the caller graph for this function:

getConfigData ( )

{Returns an array with all configuration data.

Returns
array Configuration data keyed by configuration names.
}

Implements ConfigMapperInterface.

References Drupal\configFactory(), and ConfigNamesMapper\getConfigNames().

Here is the call graph for this function:

getConfigNames ( )

{Returns an array of configuration names for the mapper.

Returns
array An array of configuration names for the mapper.
}

Implements ConfigMapperInterface.

Referenced by ConfigNamesMapper\getConfigData(), ConfigNamesMapper\getLangcode(), ConfigNamesMapper\hasSchema(), ConfigNamesMapper\hasTranslatable(), and ConfigNamesMapper\hasTranslation().

Here is the caller graph for this function:

getContextualLinkGroup ( )

{Returns the name of the contextual link group to add contextual links to.

Returns
string|null A contextual link group name or null if no link should be added.
}

Implements ConfigMapperInterface.

getDeleteRoute ( )

{Returns the route object for the translation deletion route.

Returns
The route object for the translation page.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRoute(), and ConfigNamesMapper\processRoute().

Here is the call graph for this function:

getDeleteRouteName ( )

{Returns route name for the translation deletion route.

Returns
string Route name for the mapper.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteName().

Here is the call graph for this function:

getDeleteRouteParameters ( )

{Returns the route parameters for the translation deletion route.

Returns
array
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getAddRouteParameters().

Here is the call graph for this function:

getEditRoute ( )

{Returns the route object for a translation edit form route.

Returns
The route object for the translation page.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRoute(), and ConfigNamesMapper\processRoute().

Here is the call graph for this function:

getEditRouteName ( )

{Returns route name for the translation edit form route.

Returns
string Route name for the mapper.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteName().

Here is the call graph for this function:

getEditRouteParameters ( )

{Returns the route parameters for the translation edit form route.

Returns
array
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getAddRouteParameters().

Here is the call graph for this function:

getLangcode ( )

{Returns the original language code of the configuration.

Exceptions
\RuntimeExceptionThrows an exception if the language codes in the config files don't match.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getConfigNames().

Here is the call graph for this function:

getOperations ( )

{Provides an array of information to build a list of operation links.

Returns
array An associative array of operation link data for this list, keyed by operation name, containing the following key-value pairs:
  • title: The localized title of the operation.
  • href: The path for the operation.
  • options: An array of URL options for the path.
  • weight: The weight of this operation.
}

Implements ConfigMapperInterface.

References Url\fromRoute(), ConfigNamesMapper\getOverviewRouteName(), ConfigNamesMapper\getOverviewRouteParameters(), and t().

Here is the call graph for this function:

getOverviewPath ( )

{Returns a processed path for the translation overview route.

Returns
string Processed path with placeholders replaced.
}

Implements ConfigMapperInterface.

References Url\fromRoute(), ConfigNamesMapper\getOverviewRouteName(), and ConfigNamesMapper\getOverviewRouteParameters().

Here is the call graph for this function:

getOverviewRoute ( )

{Returns the route object for a translation overview route.

Returns
The route object for the translation page.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRoute(), and ConfigNamesMapper\processRoute().

Here is the call graph for this function:

getOverviewRouteName ( )

{Returns route name for the translation overview route.

Returns
string Route name for the mapper.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteName().

Referenced by ConfigNamesMapper\getOperations(), and ConfigNamesMapper\getOverviewPath().

Here is the call graph for this function:

Here is the caller graph for this function:

getOverviewRouteParameters ( )

{Returns the route parameters for the translation overview route.

Returns
array
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getBaseRouteParameters().

Referenced by ConfigNamesMapper\getOperations(), and ConfigNamesMapper\getOverviewPath().

Here is the call graph for this function:

Here is the caller graph for this function:

getTitle ( )

{Returns title of this translation page.

Returns
string The page title.
}

Implements ConfigMapperInterface.

References t().

Referenced by ConfigNamesMapper\getTypeLabel().

Here is the call graph for this function:

Here is the caller graph for this function:

getTypeLabel ( )

{Returns the label of the type of data the mapper encapsulates.

Returns
string The label of the type of data the mapper encapsulates.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getTitle().

Here is the call graph for this function:

getTypeName ( )

{Returns the name of the type of data the mapper encapsulates.

Returns
string The name of the type of data the mapper encapsulates.
}

Implements ConfigMapperInterface.

References t().

Here is the call graph for this function:

getWeight ( )

{Returns the weight of the mapper.

Returns
int The weight of the mapper.
}

Implements ConfigMapperInterface.

hasSchema ( )

{Checks that all pieces of this configuration mapper have a schema.

Returns
bool TRUE if all of the elements have schema, FALSE otherwise.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getConfigNames().

Here is the call graph for this function:

hasTranslatable ( )

{Checks if pieces of this configuration mapper have translatables.

Returns
bool TRUE if at least one of the configuration elements has translatables, FALSE otherwise.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getConfigNames().

Here is the call graph for this function:

hasTranslation ( LanguageInterface  $language)

{Checks whether there is already a translation for this mapper.

Parameters
\Drupal\Core\Language\LanguageInterface$languageA language object.
Returns
bool TRUE if any of the configuration elements have a translation in the given language, FALSE otherwise.
}

Implements ConfigMapperInterface.

References ConfigNamesMapper\getConfigNames(), and LanguageInterface\getId().

Here is the call graph for this function:

populateFromRouteMatch ( RouteMatchInterface  $route_match)

{Populate the config mapper with request data.

Todo:
Replace $request with RouteMatch https://www.drupal.org/node/2295255.
Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
}

Implements ConfigMapperInterface.

References RouteMatchInterface\getParameter().

Here is the call graph for this function:

processRoute ( Route  $route)
protected

Allows to process all config translation routes.

Parameters
\Symfony\Component\Routing\Route$routeThe route object to process.

Referenced by ConfigNamesMapper\getAddRoute(), ConfigNamesMapper\getDeleteRoute(), ConfigNamesMapper\getEditRoute(), and ConfigNamesMapper\getOverviewRoute().

Here is the caller graph for this function:

setLangcode (   $langcode)

{Sets the original language code.

Parameters
string$langcodeThe langcode.
Returns
$this
}

Implements ConfigMapperInterface.

setRouteCollection ( RouteCollection  $collection)

{Sets the route collection.

Parameters
\Symfony\Component\Routing\RouteCollection$collectionThe route collection.
}

Implements ConfigMapperInterface.

Field Documentation

$baseRoute
protected

The base route object that the mapper is attached to.

Returns

The documentation for this class was generated from the following file: