You are here

protected function ServicesEntityResourceControllerClean::propertyQueryOperation in Services Entity API 7.2

Overridden to translate metadata property name to schema field.

Overrides ServicesEntityResourceController::propertyQueryOperation

See also

ServicesEntityResourceController::propertyQueryOperation()

File

plugins/services_entity_resource_clean.inc, line 267

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

protected function propertyQueryOperation($entity_type, EntityFieldQuery $query, $operation, $property, $value) {
  $info = entity_get_all_property_info($entity_type);
  $field = isset($info[$property]['schema field']) ? $info[$property]['schema field'] : $property;
  try {
    parent::propertyQueryOperation($entity_type, $query, $operation, $field, $value);
  } catch (ServicesException $e) {

    // Intercept a services exception and correct the property name.
    services_error(t('Parameter @prop does not exist', array(
      '@p' => $property,
    )), 406);
  }
}