You are here

function _uuid_services_entity_retrieve in Universally Unique IDentifier 7

Callback for the 'retrieve' method.

See also

entity_uuid_load()

1 string reference to '_uuid_services_entity_retrieve'
uuid_services_services_resources_alter in uuid_services/uuid_services.module
Implements hook_services_resources_alter().

File

uuid_services/uuid_services.module, line 131
UUID Services module functions.

Code

function _uuid_services_entity_retrieve($entity_type, $uuid) {
  try {
    $entities = entity_uuid_load($entity_type, array(
      $uuid,
    ));
    $entity = reset($entities);
    return $entity;
  } catch (Exception $exception) {
    watchdog_exception('uuid_services', $exception);
    return services_error($exception, 406, $uuid);
  }
}