class AdminHtmlRouteProvider extends DefaultHtmlRouteProvider (View source)

Provides HTML routes for entities with administrative add/edit/delete pages.

Use this class if the add/edit/delete form routes should use the administrative theme.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

from  DefaultHtmlRouteProvider
protected EntityFieldManagerInterface $entityFieldManager

The entity field manager.

from  DefaultHtmlRouteProvider

Methods

__construct(EntityTypeManagerInterface $entity_type_manager, 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
getAddPageRoute(EntityTypeInterface $entity_type)

Gets the add page route.

Route|null
getAddFormRoute(EntityTypeInterface $entity_type)

Gets the add-form route.

Route|null
getCanonicalRoute(EntityTypeInterface $entity_type)

Gets the canonical route.

Route|null
getEditFormRoute(EntityTypeInterface $entity_type)

Gets the edit-form route.

Route|null
getDeleteFormRoute(EntityTypeInterface $entity_type)

Gets the delete-form route.

Route|null
getCollectionRoute(EntityTypeInterface $entity_type)

Gets the collection route.

string|null
getEntityTypeIdKeyType(EntityTypeInterface $entity_type)

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

Route|null
getDeleteMultipleFormRoute(EntityTypeInterface $entity_type)

Returns the delete multiple form route.

Details

__construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager)

Constructs a new DefaultHtmlRouteProvider.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

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 getAddPageRoute(EntityTypeInterface $entity_type)

Gets the add page route.

Built only for entity types that have bundles.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.

protected Route|null getAddFormRoute(EntityTypeInterface $entity_type)

Gets the add-form route.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.

protected Route|null getCanonicalRoute(EntityTypeInterface $entity_type)

Gets the canonical route.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.

protected Route|null getEditFormRoute(EntityTypeInterface $entity_type)

Gets the edit-form route.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.

protected Route|null getDeleteFormRoute(EntityTypeInterface $entity_type)

Gets the delete-form route.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.

protected Route|null getCollectionRoute(EntityTypeInterface $entity_type)

Gets the collection 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.

protected Route|null getDeleteMultipleFormRoute(EntityTypeInterface $entity_type)

Returns the delete multiple form route.

Parameters

EntityTypeInterface $entity_type

The entity type.

Return Value

Route|null

The generated route, if available.