You are here

public function Resource::replace in RESTful 7.2

Basic implementation for update.

Parameters

string $path: The resource path.

Return value

array An array of structured data for the thing that was replaced.

Overrides ResourceInterface::replace

File

src/Plugin/resource/Resource.php, line 400
Contains \Drupal\restful\Plugin\resource\Resource.

Class

Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function replace($path) {

  // TODO: Compare this with 1.x logic.
  $object = $this
    ->getRequest()
    ->getParsedBody();
  return $this
    ->getDataProvider()
    ->update($path, $object, TRUE);
}