function entity_get_controller

Gets the entity controller class for an entity type.

Return value

Drupal\Core\Entity\EntityStorageControllerInterface

8 calls to entity_get_controller()
DefaultViewsTest::testDefaultViews in drupal/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
Test that all Default views work as expected.
EntityTranslationUITest::createEntity in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php
Creates the entity to be translated.
entity_delete_multiple in drupal/core/includes/entity.inc
Deletes multiple entities permanently.
entity_list_controller in drupal/core/includes/entity.inc
Returns an entity list controller for a given entity type.
entity_load_by_uuid in drupal/core/includes/entity.inc
Loads an entity by UUID.

... See full list

File

drupal/core/includes/entity.inc, line 275
Entity API for handling entities like nodes or users.

Code

function entity_get_controller($entity_type) {
  $controllers =& drupal_static(__FUNCTION__, array());
  if (!isset($controllers[$entity_type])) {
    $type_info = entity_get_info($entity_type);
    $class = $type_info['controller_class'];
    $controllers[$entity_type] = new $class($entity_type);
  }
  return $controllers[$entity_type];
}