public function RestWSBaseFormat::createResource in RESTful Web Services 7
Same name and namespace in other branches
- 7.2 restws.formats.inc \RestWSBaseFormat::createResource()
Creates a new resource.
Overrides RestWSFormatInterface::createResource
2 methods override RestWSBaseFormat::createResource()
- RestWSFormatRDF::createResource in ./
restws.formats.inc - Creates a new resource.
- RestWSFormatXML::createResource in ./
restws.formats.inc - Creates a new resource.
File
- ./
restws.formats.inc, line 102 - 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 createResource($resourceController, $data) {
$values = $this
->unserialize($data);
$id = $resourceController
->create($values);
$ref = self::getResourceReference($resourceController
->resource(), $id);
return $this
->serialize($ref);
}