Drupal 8  8.0.2
DefaultHtmlRouteProvider Class Reference
Inheritance diagram for DefaultHtmlRouteProvider:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager)
 
 getRoutes (EntityTypeInterface $entity_type)
 

Static Public Member Functions

static createInstance (ContainerInterface $container, EntityTypeInterface $entity_type)
 

Protected Member Functions

 getCanonicalRoute (EntityTypeInterface $entity_type)
 
 getEditFormRoute (EntityTypeInterface $entity_type)
 
 getDeleteFormRoute (EntityTypeInterface $entity_type)
 
 getEntityTypeIdKeyType (EntityTypeInterface $entity_type)
 

Protected Attributes

 $entityManager
 

Detailed Description

Provides HTML routes for entities.

This class provides the following routes for entities, with title and access callbacks:

  • canonical
  • edit-form
  • delete-form
See Also
.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager)

Constructs a new DefaultHtmlRouteProvider.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

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

{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
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe service container this object should use.
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition.
Returns
static A new instance of the entity handler.
}

Implements EntityHandlerInterface.

getCanonicalRoute ( EntityTypeInterface  $entity_type)
protected

Gets the canonical route.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type.
Returns
|null The generated route, if available.

References DefaultHtmlRouteProvider\getEntityTypeIdKeyType(), EntityTypeInterface\getLinkTemplate(), EntityTypeInterface\hasLinkTemplate(), EntityTypeInterface\hasViewBuilderClass(), and EntityTypeInterface\id().

Referenced by DefaultHtmlRouteProvider\getRoutes().

Here is the call graph for this function:

Here is the caller graph for this function:

getDeleteFormRoute ( EntityTypeInterface  $entity_type)
protected

Gets the delete-form route.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type.
Returns
|null The generated route, if available.

References DefaultHtmlRouteProvider\getEntityTypeIdKeyType(), EntityTypeInterface\getLinkTemplate(), EntityTypeInterface\hasLinkTemplate(), and EntityTypeInterface\id().

Referenced by DefaultHtmlRouteProvider\getRoutes().

Here is the call graph for this function:

Here is the caller graph for this function:

getEditFormRoute ( EntityTypeInterface  $entity_type)
protected

Gets the edit-form route.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type.
Returns
|null The generated route, if available.

References DefaultHtmlRouteProvider\getEntityTypeIdKeyType(), EntityTypeInterface\getFormClass(), EntityTypeInterface\getLinkTemplate(), EntityTypeInterface\hasLinkTemplate(), and EntityTypeInterface\id().

Referenced by DefaultHtmlRouteProvider\getRoutes().

Here is the call graph for this function:

Here is the caller graph for this function:

getEntityTypeIdKeyType ( EntityTypeInterface  $entity_type)
protected

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

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeAn entity type.
Returns
string|null The type of the ID key for a given entity type, or NULL if the entity type does not support fields.

References Drupal\entityManager(), EntityTypeInterface\getKey(), EntityTypeInterface\id(), and EntityTypeInterface\isSubclassOf().

Referenced by DefaultHtmlRouteProvider\getCanonicalRoute(), DefaultHtmlRouteProvider\getDeleteFormRoute(), and DefaultHtmlRouteProvider\getEditFormRoute().

Here is the call graph for this function:

Here is the caller graph for this function:

getRoutes ( EntityTypeInterface  $entity_type)

{Provides routes for entities.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type
Returns
|[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.
}

Implements EntityRouteProviderInterface.

References DefaultHtmlRouteProvider\getCanonicalRoute(), DefaultHtmlRouteProvider\getDeleteFormRoute(), DefaultHtmlRouteProvider\getEditFormRoute(), and EntityTypeInterface\id().

Here is the call graph for this function:


The documentation for this class was generated from the following file: