You are here

public function RestWSBaseFormat::updateResource in RESTful Web Services 7.2

Same name and namespace in other branches
  1. 7 restws.formats.inc \RestWSBaseFormat::updateResource()

Updates a resource.

Overrides RestWSFormatInterface::updateResource

1 method overrides RestWSBaseFormat::updateResource()
RestWSFormatRDF::updateResource in ./restws.formats.inc
Updates a resource.

File

./restws.formats.inc, line 134
RESTful web services module formats.

Class

RestWSBaseFormat
A base for all simple formats that are just serializing/unserializing an array of property values.

Code

public function updateResource($resourceController, $id, $data) {
  $values = $this
    ->unserialize($resourceController
    ->propertyInfo(), $data);
  $resourceController
    ->update($id, $values);

  // Return an empty representation by default.
  $value = array();
  $function = __FUNCTION__;
  drupal_alter('restws_response', $value, $function, $this->formatName, $resourceController);
  return $this
    ->serialize($value);
}