class RestWSFormatJSON in RESTful Web Services 7.2
Same name and namespace in other branches
- 7 restws.formats.inc \RestWSFormatJSON
A formatter to format json.
Hierarchy
- class \RestWSBaseFormat implements RestWSFormatInterface
- class \RestWSFormatJSON
Expanded class hierarchy of RestWSFormatJSON
2 string references to 'RestWSFormatJSON'
- hook_restws_format_info in ./
restws.api.php - Define restws compatible formats.
- restws_restws_format_info in ./
restws.module - Implements hook_restws_format_info().
File
- ./
restws.formats.inc, line 471 - RESTful web services module formats.
View source
class RestWSFormatJSON extends RestWSBaseFormat {
public function serialize($values) {
return drupal_json_encode($values);
}
public function unserialize($properties, $data) {
$values = drupal_json_decode($data);
$this
->getPropertyValues($values, $properties);
return $values;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RestWSBaseFormat:: |
protected | property | ||
RestWSBaseFormat:: |
protected | property | ||
RestWSBaseFormat:: |
public | function |
Creates a new resource. Overrides RestWSFormatInterface:: |
2 |
RestWSBaseFormat:: |
public | function |
Deletes a resource. Overrides RestWSFormatInterface:: |
|
RestWSBaseFormat:: |
protected | function | Generates all navigation links for querying. | |
RestWSBaseFormat:: |
public | function | Gets a simple PHP array using URI references for some wrapped data. | |
RestWSBaseFormat:: |
public | function |
Returns the short name of this format. Overrides RestWSFormatInterface:: |
|
RestWSBaseFormat:: |
protected | function | Transforms simple-array data values to valid entity property values. | |
RestWSBaseFormat:: |
public | function | ||
RestWSBaseFormat:: |
protected | function | Gets the resource reference value. | |
RestWSBaseFormat:: |
public | function |
Returns the mime type of this format, e.g. 'application/json' or
'application/xml'. Overrides RestWSFormatInterface:: |
|
RestWSBaseFormat:: |
public | function |
Implements RestWSFormatInterface::queryResource(). Overrides RestWSFormatInterface:: |
2 |
RestWSBaseFormat:: |
protected | function | Splits a query parameter into two sub arrays containing the filters and meta controls. | |
RestWSBaseFormat:: |
public | function |
Updates a resource. Overrides RestWSFormatInterface:: |
1 |
RestWSBaseFormat:: |
public | function |
Gets the representation of a resource. Overrides RestWSFormatInterface:: |
2 |
RestWSBaseFormat:: |
public | function | 1 | |
RestWSFormatJSON:: |
public | function | ||
RestWSFormatJSON:: |
public | function |