You are here

public function ServicesClientUUIDResourceController::update in Services Client 7.2

Implements ServicesResourceControllerInterface::update().

Overrides ServicesEntityResourceController::update

File

services_client_services/includes/ServicesClientUUIDResourceController.inc, line 61
Custom controller to allow handling requests with UUIDs.

Class

ServicesClientUUIDResourceController
@file Custom controller to allow handling requests with UUIDs.

Code

public function update($entity_type, $entity_id, array $values) {

  // Get local entity id.
  $entity_id = $this
    ->normalizeEntityId($entity_type, $entity_id);
  if (empty($entity_id)) {
    services_error('Entity or revision not found', 404);
  }

  // Merge entity id with saved values.
  $info = entity_get_info($entity_type);
  $values[$info['entity keys']['id']] = $entity_id;

  // Run save action.
  return parent::update($entity_type, $entity_id, $values);
}