class EntityModerationRouteProvider implements EntityRouteProviderInterface, EntityHandlerInterface (View source)

internal  
 

Dynamic route provider for the Content moderation module.

Provides the following routes:

  • The latest version tab, showing the latest revision of an entity, not the default one.

Properties

protected EntityFieldManagerInterface $entityFieldManager

The entity type manager.

Methods

__construct(EntityFieldManagerInterface $entity_field_manager)

Constructs a new DefaultHtmlRouteProvider.

createInstance(ContainerInterface $container, EntityTypeInterface $entity_type)

Instantiates a new instance of this entity handler.

RouteCollection|Route[]
getRoutes(EntityTypeInterface $entity_type)

Provides routes for entities.

Route|null
getLatestVersionRoute(EntityTypeInterface $entity_type)

Gets the moderation-form route.

string|null
getEntityTypeIdKeyType(EntityTypeInterface $entity_type)

Gets the type of the ID key for a given entity type.

Details

__construct(EntityFieldManagerInterface $entity_field_manager)

Constructs a new DefaultHtmlRouteProvider.

Parameters

EntityFieldManagerInterface $entity_field_manager

The entity field manager.

static EntityHandlerInterface createInstance(ContainerInterface $container, EntityTypeInterface $entity_type)

Instantiates a new instance of this entity handler.

This is a factory method that returns a new instance of this object. The factory should pass any needed dependencies into the constructor of this object, but not the container itself. Every call to this method must return a new instance of this object; that is, it may not implement a singleton.

Parameters

ContainerInterface $container

The service container this object should use.

EntityTypeInterface $entity_type

The entity type definition.

Return Value

EntityHandlerInterface

A new instance of the entity handler.

RouteCollection|Route[] getRoutes(EntityTypeInterface $entity_type)

Provides routes for entities.

Parameters

EntityTypeInterface $entity_type

The entity type

Return Value

RouteCollection|Route[]

Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

protected Route|null getLatestVersionRoute(EntityTypeInterface $entity_type)

Gets the moderation-form route.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.

protected string|null getEntityTypeIdKeyType(EntityTypeInterface $entity_type)

Gets the type of the ID key for a given entity type.

Parameters

EntityTypeInterface $entity_type

An entity type.

Return Value

string|null

The type of the ID key for a given entity type, or NULL if the entity type does not support fields.