Drupal 8  8.0.2
EntityController Class Reference
Inheritance diagram for EntityController:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, TranslationInterface $string_translation)
 
 title (RouteMatchInterface $route_match, EntityInterface $_entity=NULL)
 
 editTitle (RouteMatchInterface $route_match, EntityInterface $_entity=NULL)
 
 deleteTitle (RouteMatchInterface $route_match, EntityInterface $_entity=NULL)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Member Functions

 doGetEntity (RouteMatchInterface $route_match, EntityInterface $_entity=NULL)
 

Protected Attributes

 $entityManager
 

Detailed Description

Provides generic entity title callbacks for use in routing.

It provides:

  • A view title callback.
  • An edit title callback.
  • A delete title callback.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
TranslationInterface  $string_translation 
)

Constructs a new EntityController.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationThe string translation.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container)
static

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

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe service container this instance should use.
}

Implements ContainerInjectionInterface.

deleteTitle ( RouteMatchInterface  $route_match,
EntityInterface  $_entity = NULL 
)

Provides a generic delete title callback.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
\Drupal\Core\Entity\EntityInterface$_entity(optional) An entity, passed in directly from the request attributes, and set in .
Returns
string The title for the delete entity page.

References EntityController\doGetEntity(), and t().

Here is the call graph for this function:

doGetEntity ( RouteMatchInterface  $route_match,
EntityInterface  $_entity = NULL 
)
protected

Determines the entity.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
\Drupal\Core\Entity\EntityInterface$_entity(optional) The entity, set in .
Returns
|NULL The entity, if it is passed in directly or if the first parameter of the active route is an entity; otherwise, NULL.

References Drupal\entityManager(), and RouteMatchInterface\getParameters().

Referenced by EntityController\deleteTitle(), EntityController\editTitle(), and EntityController\title().

Here is the call graph for this function:

Here is the caller graph for this function:

editTitle ( RouteMatchInterface  $route_match,
EntityInterface  $_entity = NULL 
)

Provides a generic edit title callback.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
\Drupal\Core\Entity\EntityInterface$_entity(optional) An entity, passed in directly from the request attributes.
Returns
string The title for the entity edit page.

References EntityController\doGetEntity(), and t().

Here is the call graph for this function:

title ( RouteMatchInterface  $route_match,
EntityInterface  $_entity = NULL 
)

Provides a generic title callback for a single entity.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
\Drupal\Core\Entity\EntityInterface$_entity(optional) An entity, passed in directly from the request attributes.
Returns
string The title for the entity view page.

References EntityController\doGetEntity().

Here is the call graph for this function:


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