EntityResolverManager
class EntityResolverManager (View source)
Sets the entity route parameter converter options automatically.
If controllers of routes with route parameters, type-hint the parameters with an entity interface, upcasting is done automatically.
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager service. |
|
| protected ClassResolverInterface | $classResolver | The class resolver. |
Methods
Constructs a new EntityRouteAlterSubscriber.
Gets the controller class using route defaults.
Sets the upcasting information using reflection.
Sets the upcasting information using the entity* route defaults.
Set the upcasting route objects.
Gets the list of all entity types.
Details
__construct(EntityTypeManagerInterface $entity_type_manager, ClassResolverInterface $class_resolver)
Constructs a new EntityRouteAlterSubscriber.
protected string|null
getControllerClass(array $defaults)
Gets the controller class using route defaults.
By design we cannot support all possible routes, but just the ones which use the defaults provided by core, which are _controller and _form.
Rather than creating an instance of every controller determine the class and method that would be used. This is not possible for the service:method notation as the runtime container does not allow static introspection.
protected bool
setParametersFromReflection(string|array $controller, Route $route)
Sets the upcasting information using reflection.
protected
setParametersFromEntityInformation(Route $route)
Sets the upcasting information using the entity* route defaults.
Supports the '_entity_view' and '_entity_form' route defaults.
setRouteOptions(Route $route)
Set the upcasting route objects.
protected EntityTypeInterface[]
getEntityTypes()
Gets the list of all entity types.