class EntityRouteAlterSubscriber implements EventSubscriberInterface (View source)

Registers the 'type' of route parameter names that match an entity type.

Matching on parameter *name* is not ideal, because it breaks encapsulation: parameter names are local to the controller and route, and controllers and routes can't be expected to know what all possible entity types might exist across all modules in order to pick names that don't conflict. Instead, the 'type' should be determined from introspecting what kind of PHP variable (e.g., a type hinted interface) the controller requires: https://www.drupal.org/node/2041907.

Properties

protected EntityResolverManager $resolverManager

The entity resolver manager.

Methods

__construct(EntityResolverManager $entity_resolver_manager)

Constructs an EntityRouteAlterSubscriber instance.

onRoutingRouteAlterSetType(RouteBuildEvent $event)

Applies parameter converters to route parameters.

static 
getSubscribedEvents()

{@inheritdoc}

Details

__construct(EntityResolverManager $entity_resolver_manager)

Constructs an EntityRouteAlterSubscriber instance.

Parameters

EntityResolverManager $entity_resolver_manager

The entity resolver manager.

onRoutingRouteAlterSetType(RouteBuildEvent $event)

Applies parameter converters to route parameters.

Parameters

RouteBuildEvent $event

The event to process.

static getSubscribedEvents()

{@inheritdoc}