Loads a test_entity.
$ftid: The id of the entity to load.
$ftvid: (Optional) The revision id of the entity to load. If not specified, the current revision will be used.
The loaded entity.
function field_test_entity_test_load($ftid, $ftvid = NULL) {
// Prevent this from being called as hook_entity_test_load().
if (is_array($ftid)) {
return;
}
$ids = isset($ftid) ? array(
$ftid,
) : array();
$conditions = isset($ftvid) ? array(
'ftvid' => $ftvid,
) : array();
$test_entity = entity_load_multiple('test_entity', $ids, $conditions);
return $test_entity ? reset($test_entity) : FALSE;
}