interface ConfigMapperInterface (View source)

Defines an interface for configuration mapper.

Methods

string
getTitle()

Returns title of this translation page.

setRouteCollection(RouteCollection $collection)

Sets the route collection.

string
getBaseRouteName()

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

array
getBaseRouteParameters()

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

Route
getBaseRoute()

Returns the base route object the mapper is attached to.

string
getBasePath()

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

string
getOverviewRouteName()

Returns route name for the translation overview route.

array
getOverviewRouteParameters()

Returns the route parameters for the translation overview route.

Route
getOverviewRoute()

Returns the route object for a translation overview route.

string
getOverviewPath()

Returns a processed path for the translation overview route.

string
getAddRouteName()

Returns route name for the translation add form route.

array
getAddRouteParameters()

Returns the route parameters for the translation add form route.

Route
getAddRoute()

Returns the route object for a translation add form route.

string
getEditRouteName()

Returns route name for the translation edit form route.

array
getEditRouteParameters()

Returns the route parameters for the translation edit form route.

Route
getEditRoute()

Returns the route object for a translation edit form route.

string
getDeleteRouteName()

Returns route name for the translation deletion route.

array
getDeleteRouteParameters()

Returns the route parameters for the translation deletion route.

Route
getDeleteRoute()

Returns the route object for the translation deletion route.

array
getConfigNames()

Returns an array of configuration names for the mapper.

addConfigName(string $name)

Adds the given configuration name to the list of names.

int
getWeight()

Returns the weight of the mapper.

array
getConfigData()

Returns an array with all configuration data.

getLangcode()

Returns the original language code of the configuration.

string
getLangcodeFromConfig(string $config_name)

Returns the language code of a configuration object given its name.

$this
setLangcode(string $langcode)

Sets the original language code.

string
getTypeName()

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

array
getOperations()

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

string
getTypeLabel()

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

bool
hasSchema()

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

bool
hasTranslatable()

Checks if pieces of this configuration mapper have translatables.

bool
hasTranslation(LanguageInterface $language)

Checks whether there is already a translation for this mapper.

populateFromRouteMatch(RouteMatchInterface $route_match)

Populate the config mapper with route match data.

string|null
getContextualLinkGroup()

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

Details

string getTitle()

Returns title of this translation page.

Return Value

string

The page title.

setRouteCollection(RouteCollection $collection)

Sets the route collection.

Parameters

RouteCollection $collection

The route collection.

string getBaseRouteName()

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

Return Value

string

The name of the base route the mapper is attached to.

array getBaseRouteParameters()

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

Return Value

array

Route getBaseRoute()

Returns the base route object the mapper is attached to.

Return Value

Route

The base route object the mapper is attached to.

string getBasePath()

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

Return Value

string

Processed path with placeholders replaced.

string getOverviewRouteName()

Returns route name for the translation overview route.

Return Value

string

Route name for the mapper.

array getOverviewRouteParameters()

Returns the route parameters for the translation overview route.

Return Value

array

Route getOverviewRoute()

Returns the route object for a translation overview route.

Return Value

Route

The route object for the translation page.

string getOverviewPath()

Returns a processed path for the translation overview route.

Return Value

string

Processed path with placeholders replaced.

string getAddRouteName()

Returns route name for the translation add form route.

Return Value

string

Route name for the mapper.

array getAddRouteParameters()

Returns the route parameters for the translation add form route.

Return Value

array

Route getAddRoute()

Returns the route object for a translation add form route.

Return Value

Route

The route object for the translation page.

string getEditRouteName()

Returns route name for the translation edit form route.

Return Value

string

Route name for the mapper.

array getEditRouteParameters()

Returns the route parameters for the translation edit form route.

Return Value

array

Route getEditRoute()

Returns the route object for a translation edit form route.

Return Value

Route

The route object for the translation page.

string getDeleteRouteName()

Returns route name for the translation deletion route.

Return Value

string

Route name for the mapper.

array getDeleteRouteParameters()

Returns the route parameters for the translation deletion route.

Return Value

array

Route getDeleteRoute()

Returns the route object for the translation deletion route.

Return Value

Route

The route object for the translation page.

array getConfigNames()

Returns an array of configuration names for the mapper.

Return Value

array

An array of configuration names for the mapper.

addConfigName(string $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 $name

Configuration name.

int getWeight()

Returns the weight of the mapper.

Return Value

int

The weight of the mapper.

array getConfigData()

Returns an array with all configuration data.

Return Value

array

Configuration data keyed by configuration names.

getLangcode()

Returns the original language code of the configuration.

Exceptions

RuntimeException

string getLangcodeFromConfig(string $config_name)

Returns the language code of a configuration object given its name.

Parameters

string $config_name

The name of the configuration object.

Return Value

string

The language code of the configuration object.

$this setLangcode(string $langcode)

Sets the original language code.

Parameters

string $langcode

The langcode.

Return Value

$this

string getTypeName()

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

Return Value

string

The name of the type of data the mapper encapsulates.

array getOperations()

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

Return Value

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.

string getTypeLabel()

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

Return Value

string

The label of the type of data the mapper encapsulates.

bool hasSchema()

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

Return Value

bool

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

bool hasTranslatable()

Checks if pieces of this configuration mapper have translatables.

Return Value

bool

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

bool hasTranslation(LanguageInterface $language)

Checks whether there is already a translation for this mapper.

Parameters

LanguageInterface $language

A language object.

Return Value

bool

TRUE if any of the configuration elements have a translation in the given language, FALSE otherwise.

populateFromRouteMatch(RouteMatchInterface $route_match)

Populate the config mapper with route match data.

Parameters

RouteMatchInterface $route_match

The route match.

See also

ConfigTranslationEvents::POPULATE_MAPPER

string|null getContextualLinkGroup()

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

Return Value

string|null

A contextual link group name or null if no link should be added.