You are here

public function Resource::create in RESTful 7.2

Basic implementation for create.

Parameters

string $path: The resource path.

Return value

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

Overrides ResourceInterface::create

File

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

Class

Resource

Namespace

Drupal\restful\Plugin\resource

Code

public function create($path) {

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