You are here

class RestWSFormatJSON in RESTful Web Services 7

Same name and namespace in other branches
  1. 7.2 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 196
RESTful web services module formats.

View source
class RestWSFormatJSON extends RestWSBaseFormat {
  public function serialize($values) {
    return drupal_json_encode($values);
  }
  public function unserialize($data) {
    return drupal_json_decode($data);
  }

}

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::getData public static 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::getResourceReference public static function
RestWSBaseFormat::mimeType public function Returns the mime type of this format, e.g. 'application/json' or 'application/xml'. Overrides RestWSFormatInterface::mimeType
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