interface RestWSFormatInterface in RESTful Web Services 7.2
Same name and namespace in other branches
- 7 restws.formats.inc \RestWSFormatInterface
Interface implemented by formatter implementations for the http client.
Hierarchy
- interface \RestWSFormatInterface
Expanded class hierarchy of RestWSFormatInterface
All classes that implement RestWSFormatInterface
File
- ./
restws.formats.inc, line 11 - RESTful web services module formats.
View source
interface RestWSFormatInterface {
/**
* Gets the representation of a resource.
*
* @param RestWSResourceControllerInterface $resourceController
* The controller used to retrieve the resource.
* @param int|string $id
* The id of the resource that should be returned.
*
* @return string
* The representation of the resource.
*/
public function viewResource($resourceController, $id);
/**
* Create a resource.
*
* @param RestWSResourceControllerInterface $resourceController
* The controller used to create the resource.
* @param string $data
* The representation of the resource.
*
* @return int|string
* The id of the newly created resource.
*/
public function createResource($resourceController, $data);
/**
* Update a resource.
*
* @param RestWSResourceControllerInterface $resourceController
* The controller used to update the resource.
* @param int|string $id
* The id of the resource that should be updated.
* @param string $data
* The representation of the resource.
*/
public function updateResource($resourceController, $id, $data);
/**
* Delete a resource.
*
* @param RestWSResourceControllerInterface $resourceController
* The controller used to update the resource.
* @param int|string $id
* The id of the resource that should be deleted.
*/
public function deleteResource($resourceController, $id);
/**
* Query for a resource.
*
* If a format doesn't want to implement querying, then it should throw an
* RestWSException with the 501 HTTP status code.
*
* @param RestWSResourceControllerInterface $resourceController
* The controller used to query the resource.
* @param array $payload
* An optional way to pass the query parameters.
*
* @return string
* The serialized representation of a list of resources.
*/
public function queryResource($resourceController, $payload);
/**
* Returns the mime type of this format, e.g. 'application/json' or
* 'application/xml'.
*/
public function mimeType();
/**
* Returns the short name of this format.
*
* @return string
* The format name, example: "json".
*/
public function getName();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RestWSFormatInterface:: |
public | function | Create a resource. | 1 |
RestWSFormatInterface:: |
public | function | Delete a resource. | 1 |
RestWSFormatInterface:: |
public | function | Returns the short name of this format. | 1 |
RestWSFormatInterface:: |
public | function | Returns the mime type of this format, e.g. 'application/json' or 'application/xml'. | 1 |
RestWSFormatInterface:: |
public | function | Query for a resource. | 1 |
RestWSFormatInterface:: |
public | function | Update a resource. | 1 |
RestWSFormatInterface:: |
public | function | Gets the representation of a resource. | 1 |