Defines a generic controller to list entities.
Expanded class hierarchy of EntityListController
class EntityListController implements ControllerInterface {
/**
* The entity manager
*
* @var \Drupal\Core\Entity\EntityManager
*/
protected $entityManager;
/**
* Creates an EntityListController object.
*
* @param \Drupal\Core\Entity\EntityManager $entity_manager
* The entity manager.
*/
public function __construct(EntityManager $entity_manager) {
$this->entityManager = $entity_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('plugin.manager.entity'));
}
/**
* Provides the listing page for any entity type.
*
* @return array
* A render array as expected by drupal_render().
*/
public function listing($entity_type) {
return $this->entityManager
->getListController($entity_type)
->render();
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityListController:: |
protected | property | The entity manager | |
EntityListController:: |
public static | function |
Instantiates a new instance of this controller. Overrides ControllerInterface:: |
|
EntityListController:: |
public | function | Provides the listing page for any entity type. | |
EntityListController:: |
public | function | Creates an EntityListController object. |