protected function PluginTypeBasedConverterTrait::getConverterDefinition in Plugin 8.2
Gets the converter-specific parameter definition.
Parameters
mixed[] $definition:
Return value
mixed[]|null The processed definition or NULL if there is no definition
2 calls to PluginTypeBasedConverterTrait::getConverterDefinition()
- PluginTypeBasedConverterTrait::applies in src/
ParamConverter/ PluginTypeBasedConverterTrait.php - Implements \Drupal\Core\ParamConverter\ParamConverterInterface::applies().
- PluginTypeBasedConverterTrait::convert in src/
ParamConverter/ PluginTypeBasedConverterTrait.php - Implements \Drupal\Core\ParamConverter\ParamConverterInterface::convert().
File
- src/
ParamConverter/ PluginTypeBasedConverterTrait.php, line 97
Class
- PluginTypeBasedConverterTrait
- Implements \Drupal\Core\ParamConverter\ParamConverterInterface for plugin type-based route parameter converters.
Namespace
Drupal\plugin\ParamConverterCode
protected function getConverterDefinition(array $definition) {
// There is no converter-specific definition.
if (!array_key_exists($this
->getConverterDefinitionKey(), $definition)) {
return NULL;
}
$converter_definition = $definition[$this
->getConverterDefinitionKey()];
// Merge in defaults.
$converter_definition += [
'enabled' => TRUE,
];
// The definition is disabled.
if (!$converter_definition['enabled']) {
return NULL;
}
return $converter_definition;
}