AdminPathConfigEntityConverter
class AdminPathConfigEntityConverter extends EntityConverter (View source)
Makes sure the unmodified ConfigEntity is loaded on admin pages.
Converts entity route arguments to unmodified entities as opposed to converting to entities with overrides, such as the negotiated language.
This converter applies only if the path is an admin path, the entity is a config entity, and the "with_config_overrides" element is not set to TRUE on the parameter definition.
Due to this converter having a higher weight than the default EntityConverter, every time this applies, it takes over the conversion duty from EntityConverter. As we only allow a single converter per route argument, EntityConverter is ignored when this converter applies.
Traits
Provides a trait to replace dynamic entity types in routes.
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | Entity type manager which performs the upcasting in the end. |
from EntityConverter |
| protected EntityRepositoryInterface | $entityRepository | Entity repository. |
from EntityConverter |
| protected ConfigFactoryInterface | $configFactory | The config factory. |
|
| protected AdminContext | $adminContext | The route admin context to determine whether a route is an admin one. |
Methods
Determines the entity type ID given a route definition and route defaults.
Constructs a new EntityConverter.
Converts path variables to their corresponding objects.
Determines if the converter applies to a specific route and variable.
Details
protected string
getEntityTypeFromDefaults(mixed $definition, string $name, array $defaults)
Determines the entity type ID given a route definition and route defaults.
__construct(EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory, AdminContext $admin_context, EntityRepositoryInterface $entity_repository = NULL)
Constructs a new EntityConverter.
mixed|null
convert(mixed $value, mixed $definition, string $name, array $defaults)
Converts path variables to their corresponding objects.
bool
applies(mixed $definition, string $name, Route $route)
Determines if the converter applies to a specific route and variable.