public function EntityManager::getStorageController

Creates a new storage controller instance.

Parameters

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

Return value

\Drupal\Core\Entity\EntityStorageControllerInterface A storage controller instance.

1 call to EntityManager::getStorageController()
EntityManager::getListController in drupal/core/lib/Drupal/Core/Entity/EntityManager.php
Creates a new list controller instance.

File

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

Class

EntityManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

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