entity_get_controller

Versions
mediamosa-21
entity_get_controller($entity_type)

Get the entity controller class for an entity type.

▾ 6 functions call entity_get_controller()

entity_load in includes/common.inc
Load entities from the database.
node_delete_multiple in modules/node/node.module
Delete multiple nodes.
taxonomy_terms_static_reset in modules/taxonomy/taxonomy.module
Clear all static cache variables for terms..
taxonomy_vocabulary_delete in modules/taxonomy/taxonomy.module
Delete a vocabulary.
taxonomy_vocabulary_save in modules/taxonomy/taxonomy.module
Save a vocabulary given a vocabulary object.
user_delete_multiple in modules/user/user.module
Delete multiple user accounts.

Code

includes/common.inc, line 6392

<?php
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];
}
?>