You are here

public static function EntityHelper::loadSingle in Helper 7

A wrapper around entity_load() to load a single entity by ID.

Parameters

string $entity_type: The entity type of $entity.

int $entity_id: The ID of the entity to load.

Return value

object The entity object, or FALSE on failure.

See also

entity_load()

File

lib/EntityHelper.php, line 18

Class

EntityHelper

Code

public static function loadSingle($entity_type, $entity_id) {
  $entities = entity_load($entity_type, array(
    $entity_id,
  ));
  return reset($entities);
}