EntityRevisionParamConverter
class EntityRevisionParamConverter implements ParamConverterInterface (View source)
Parameter converter for upcasting entity revision IDs to full objects.
This is useful for pages which want to show a specific revision, like "/entity_example/{entity_example}/revision/{entity_example_revision}".
In order to use it you should specify some additional options in your route:
Traits
Provides a trait to replace dynamic entity types in routes.
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected EntityRepositoryInterface | $entityRepository | The entity repository. |
Methods
Determines the entity type ID given a route definition and route defaults.
Creates a new EntityRevisionParamConverter instance.
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, EntityRepositoryInterface $entity_repository)
Creates a new EntityRevisionParamConverter instance.
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.