You are here

public function ServicesEntityResourceControllerClean::retrieve in Services Entity API 7.2

Implements ServicesResourceControllerInterface::retrieve().

Overrides ServicesEntityResourceController::retrieve

File

plugins/services_entity_resource_clean.inc, line 74

Class

ServicesEntityResourceControllerClean
This class is designed to create a very clean API that integrates with the services and entity modules. We want to strip all "drupalisms" out of the API. For example, there should be no [LANGUAGE_NONE][0][value] or field_ in the API.

Code

public function retrieve($entity_type, $entity_id, $fields, $revision) {
  $entity = parent::retrieve($entity_type, $entity_id, '*', $revision);
  return $this
    ->get_data(entity_metadata_wrapper($entity_type, $entity), $fields);
}