Detailed Description

AbstractFormat maybe 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)
 
- Public Member Functions inherited from Format
 getMimeType ()
 

Protected Member Functions

 getRequest ()
 
 getResponse ()
 
 beforeDeserialize ($values)
 
 deserializeValues ($values)
 
 afterDeserialize ($values)
 
 beforeSerialize ($values)
 
 serializeValues ($values)
 
 afterSerialize ($values)
 
 getNode (ObjectId $oid)
 
 filterValue ($value, AttributeDescription $attribute)
 

Member Function Documentation

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

Implements Format.

Definition at line 36 of file AbstractFormat.php.

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

Implements Format.

Definition at line 48 of file AbstractFormat.php.

getRequest ( )
protected

Get the currently deserialized request.

Returns
Request

Definition at line 61 of file AbstractFormat.php.

getResponse ( )
protected

Get the currently deserialized response.

Returns
Response

Definition at line 69 of file AbstractFormat.php.

beforeDeserialize (   $values)
protected

Modify data before deserialization.

The default implementation does nothing.

Parameters
$valuesThe request values
Returns
The modified values array
Note
Subclasses override this if necessary

Definition at line 79 of file AbstractFormat.php.

deserializeValues (   $values)
abstractprotected

Deserialize an array of values.

Parameters
$valuesThe array/object of values
Returns
The array/object of values
afterDeserialize (   $values)
protected

Modify data after deserialization.

The default implementation does nothing.

Parameters
$valuesThe request values
Returns
The modified values array
Note
Subclasses override this if necessary

Definition at line 96 of file AbstractFormat.php.

beforeSerialize (   $values)
protected

Modify data before serialization.

The default implementation does nothing.

Parameters
$valuesThe response values
Returns
The modified values array
Note
Subclasses override this if necessary

Definition at line 106 of file AbstractFormat.php.

serializeValues (   $values)
abstractprotected

Serialize an array of values.

Parameters
$valuesThe array/object of values
Returns
The array/object of values
afterSerialize (   $values)
protected

Modify data after serialization.

The default implementation does nothing.

Parameters
$valuesThe response values
Returns
The modified values array
Note
Subclasses override this if necessary

Definition at line 123 of file AbstractFormat.php.

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
A reference to the Node instance

Definition at line 137 of file AbstractFormat.php.

filterValue (   $value,
AttributeDescription  $attribute 
)
protected

Definition at line 156 of file AbstractFormat.php.