public function EntityManager::getListController

Creates a new list controller instance.

Parameters

string $entity_type: The entity type for this list controller.

Return value

\Drupal\Core\Entity\EntityListControllerInterface A list controller instance.

File

drupal/core/lib/Drupal/Core/Entity/EntityManager.php, line 159
Contains \Drupal\Core\Entity\EntityManager.

Class

EntityManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

public function getListController($entity_type) {
  if (!isset($this->controllers['listing'][$entity_type])) {
    $class = $this
      ->getControllerClass($entity_type, 'list');
    if (in_array('Drupal\\Core\\Entity\\EntityControllerInterface', class_implements($class))) {
      $this->controllers['listing'][$entity_type] = $class::createInstance($this->container, $entity_type, $this
        ->getDefinition($entity_type));
    }
    else {
      $this->controllers['listing'][$entity_type] = new $class($entity_type, $this
        ->getStorageController($entity_type));
    }
  }
  return $this->controllers['listing'][$entity_type];
}