Detailed Description

AbstractFormat is used as base class for specialized formats.

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

Definition at line 27 of file AbstractFormat.php.

+ Inheritance diagram for AbstractFormat:

Public Member Functions

 deserialize (Request $request)
 
 serialize (Response $response)
 
 getResponseHeaders (Response $response)
 
- Public Member Functions inherited from Format
 getMimeType (Response $response=null)
 
 isCached (Response $response)
 
 getCacheDate (Response $response)
 

Protected Member Functions

 beforeDeserialize (Request $request)
 
 deserializeValues (Request $request)
 
 afterDeserialize (Request $request)
 
 beforeSerialize (Response $response)
 
 serializeValues (Response $response)
 
 afterSerialize (Response $response)
 
 getNode (ObjectId $oid)
 
 filterValue ($value, AttributeDescription $attribute)
 

Member Function Documentation

◆ deserialize()

deserialize ( Request  $request)
See also
Format::deserialize()

Implements Format.

Definition at line 34 of file AbstractFormat.php.

◆ serialize()

serialize ( Response  $response)
See also
Format::serialize()

Implements Format.

Definition at line 43 of file AbstractFormat.php.

◆ getResponseHeaders()

getResponseHeaders ( Response  $response)
See also
Format::getResponseHeaders()

Implements Format.

Reimplemented in DownloadFormat.

Definition at line 52 of file AbstractFormat.php.

◆ beforeDeserialize()

beforeDeserialize ( Request  $request)
protected

Modify data before deserialization.

The default implementation does nothing.

Parameters
$requestThe request
Returns
Array/object of values
Note
Subclasses override this if necessary

Definition at line 63 of file AbstractFormat.php.

◆ deserializeValues()

deserializeValues ( Request  $request)
abstractprotected

Deserialize an array of values.

Parameters
$requestThe request
Returns
Array/object of values

Reimplemented in HtmlFormat, DownloadFormat, GenericFormat, NullFormat, and HierarchicalFormat.

◆ afterDeserialize()

afterDeserialize ( Request  $request)
protected

Modify data after deserialization.

The default implementation does nothing.

Parameters
$requestThe request
Returns
Array/object of values
Note
Subclasses override this if necessary

Definition at line 80 of file AbstractFormat.php.

◆ beforeSerialize()

beforeSerialize ( Response  $response)
protected

Modify data before serialization.

The default implementation does nothing.

Parameters
$responseThe response
Returns
Array/object of values
Note
Subclasses override this if necessary

Definition at line 90 of file AbstractFormat.php.

◆ serializeValues()

serializeValues ( Response  $response)
abstractprotected

Serialize an array of values.

Parameters
$responseThe response
Returns
Array/object of values

Reimplemented in HtmlFormat, DownloadFormat, GenericFormat, NullFormat, and HierarchicalFormat.

◆ afterSerialize()

afterSerialize ( Response  $response)
protected

Modify data after serialization.

The default implementation does nothing.

Parameters
$responseThe response
Returns
Array/object of values
Note
Subclasses override this if necessary

Reimplemented in JsonFormat, and GenericFormat.

Definition at line 107 of file AbstractFormat.php.

◆ getNode()

getNode ( ObjectId  $oid)
protected

Helper methods.

Get a node with the given oid to deserialize values from form fields into it. The method ensures that there is only one instance per oid.

Parameters
$oidThe oid
Returns
Node

Definition at line 121 of file AbstractFormat.php.

◆ filterValue()

filterValue (   $value,
AttributeDescription  $attribute 
)
protected

Definition at line 140 of file AbstractFormat.php.