\RESTFormatter_JSON
Synopsis
class RESTFormatter_JSON
extends RESTFormatter
{
- // members
- public static array $mimetypes = ;
- public static array $url_extensions = ;
- public static string $type_attribute = '$type';
- // Inherited members from RESTFormatter
- public static string $default;
- // methods
- public void dataItem()
- public void addToItem()
- public void addCollectionToItem()
- public void appendToCollection()
- public void buildResponse()
- // Inherited methods from RESTFormatter
- public static RESTFormatter get_formatter()
- public array decodeFields()
- public void format()
- protected any collectFields()
- public abstract void dataItem()
- public abstract void addToItem()
- public abstract any addCollectionToItem()
- public abstract void appendToCollection()
- protected abstract SS_HTTPResponse buildResponse()
Hierarchy
Extends
Members
public
- $default
- $mimetypes
- $type_attribute
- $url_extensions
Methods
public
Inherited from RESTFormatter
protected
- buildResponse() — Takes the noun we build the data from and the data as built by collectFields, and returns an HTTPResponse object that contains the finally formatted data
- collectFields() — Given a fieldspec and a noun, recursively collect the specified fields into a "data" element - a subclass specific object that can then be trivially converted into the expected response.
public
- addCollectionToItem() — Works in concert with #appendToCollection to handle sequences.
- addToItem() — Add a key / value pair to an object as returned by dataItem
- appendToCollection() — Add a value to a sequence
- dataItem() — Given a class as a string, return a "data" item - some object that can hold data during collection
- decodeFields() — Takes a list of fields - a list of "." seperated strings - and turns it into a fieldspec (a nested associative array), where the key is the field, and the value is an array of nested fields or false if no nesting, i.e.
- format() — format is the main public entry point for formatting RESTNouns as output
- get_formatter() — Factory that returns a RESTFormatter subclass that formats in a particular format based on mimetype or extension