You are here

class RestWSFormatJSON in RESTful Web Services 7.2

Same name and namespace in other branches
  1. 7 restws.formats.inc \RestWSFormatJSON

A formatter to format json.

Hierarchy

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

Namesort descending Modifiers Type Description Overrides
RestWSBaseFormat::$formatInfo protected property
RestWSBaseFormat::$formatName protected property
RestWSBaseFormat::createResource public function Creates a new resource. Overrides RestWSFormatInterface::createResource 2
RestWSBaseFormat::deleteResource public function Deletes a resource. Overrides RestWSFormatInterface::deleteResource
RestWSBaseFormat::generateQueryURIs protected function Generates all navigation links for querying.
RestWSBaseFormat::getData public function Gets a simple PHP array using URI references for some wrapped data.
RestWSBaseFormat::getName public function Returns the short name of this format. Overrides RestWSFormatInterface::getName
RestWSBaseFormat::getPropertyValues protected function Transforms simple-array data values to valid entity property values.
RestWSBaseFormat::getResourceReference public function
RestWSBaseFormat::getResourceReferenceValue protected function Gets the resource reference value.
RestWSBaseFormat::mimeType public function Returns the mime type of this format, e.g. 'application/json' or 'application/xml'. Overrides RestWSFormatInterface::mimeType
RestWSBaseFormat::queryResource public function Implements RestWSFormatInterface::queryResource(). Overrides RestWSFormatInterface::queryResource 2
RestWSBaseFormat::splitParameters protected function Splits a query parameter into two sub arrays containing the filters and meta controls.
RestWSBaseFormat::updateResource public function Updates a resource. Overrides RestWSFormatInterface::updateResource 1
RestWSBaseFormat::viewResource public function Gets the representation of a resource. Overrides RestWSFormatInterface::viewResource 2
RestWSBaseFormat::__construct public function 1
RestWSFormatJSON::serialize public function
RestWSFormatJSON::unserialize public function