Format Interface Reference

Detailed Description

Format defines the interface for all format classes.

Format instances are used to map external data representations like JSON, XML/SOAP or HTML to internal ones and vice versa. All data values are supposed to be scalar or array values except for wcmf::lib::model::Node instances, for which each external representation defines a special notation.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 25 of file Format.php.

+ Inheritance diagram for Format:

Public Member Functions

 getMimeType ()
 
 deserialize (Request $request)
 
 serialize (Response $response)
 
 isCached (Response $response)
 
 getCacheDate (Response $response)
 
 getResponseHeaders (Response $response)
 

Member Function Documentation

getMimeType ( )

Get the MIME type of the format.

Returns
String

Implemented in JsonFormat, HtmlFormat, SoapFormat, DownloadFormat, GenericFormat, and NullFormat.

deserialize ( Request  $request)

Deserialize Request data from the external representation into Nodes and scalars/arrays.

Parameters
$requestThe Request instance

Implemented in AbstractFormat.

serialize ( Response  $response)

Serialize Response data according to the external representation.

Parameters
$responseThe Response instance

Implemented in AbstractFormat.

isCached ( Response  $response)

Check if the response identified by it's cache id is cached for this format.

Parameters
$responseThe Response instance
Returns
Boolean

Implemented in JsonFormat, HtmlFormat, SoapFormat, DownloadFormat, GenericFormat, and NullFormat.

getCacheDate ( Response  $response)

Get the caching date, if the response is cached.

Parameters
$responseThe Response instance
Returns
DateTime or null, if not cached

Implemented in JsonFormat, HtmlFormat, SoapFormat, DownloadFormat, GenericFormat, and NullFormat.

getResponseHeaders ( Response  $response)

Get the response headers.

Parameters
$responseThe Response instance
Returns
Associative array with header names and values

Implemented in DownloadFormat, and AbstractFormat.