wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
HierarchicalFormat Class Reference
+ Inheritance diagram for HierarchicalFormat:

Public Member Functions

 deserialize (&$request)
 
 serialize (&$response)
 
 processValues (&$value, $key, $method)
 
 beforeDeserialize (&$data)
 
 afterDeserialize (&$data)
 
 beforeSerialize (&$data)
 
 afterSerialize (&$data)
 
 isSerializedNode ($key, &$value)
 
 isDeserializedNode ($key, &$value)
 
 serializeNode ($key, &$value)
 
deserializeNode ($key, &$value)
 
- Public Member Functions inherited from AbstractFormat
getNode ($oid)
 
 getNodes ()
 
- Public Member Functions inherited from IFormat
 deserialize (&$request)
 
 serialize (&$response)
 

Additional Inherited Members

- Public Attributes inherited from AbstractFormat
 $_deserializedNodes = null
 

Detailed Description

HierarchicalFormat maybe used as base class for formats that are able to represent hierarchical data like JSON or XML. This format automatically iterates over data when de-/serializing and uses template methods to implement the specific format.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.HierarchicalFormat.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 31 of file class.HierarchicalFormat.php.

Member Function Documentation

HierarchicalFormat::deserialize ( $request)
See Also
IFormat::deserialize()

Definition at line 36 of file class.HierarchicalFormat.php.

References afterDeserialize(), ArrayUtil\array_walk_recursive(), and beforeDeserialize().

+ Here is the call graph for this function:

HierarchicalFormat::serialize ( $response)
See Also
IFormat::serialize()

Definition at line 48 of file class.HierarchicalFormat.php.

References afterSerialize(), ArrayUtil\array_walk_recursive(), and beforeSerialize().

+ Here is the call graph for this function:

HierarchicalFormat::processValues ( $value,
  $key,
  $method 
)

Callback function for array_walk_recursive. De-/Serializes any Node instances using the function given in method parameter.

Parameters
valueThe array value
keyThe array key
methodThe method to apply to each value

Definition at line 64 of file class.HierarchicalFormat.php.

References EncodingUtil\convertCp1252Utf8ToIso(), isDeserializedNode(), isSerializedNode(), and EncodingUtil\isUtf8().

+ Here is the call graph for this function:

HierarchicalFormat::beforeDeserialize ( $data)

Template methods Modify data before deserialization. The default implementation does nothing.

Parameters
dataA reference to the data array
Note
Subclasses override this if necessary

Definition at line 85 of file class.HierarchicalFormat.php.

Referenced by deserialize().

HierarchicalFormat::afterDeserialize ( $data)

Modify data after deserialization. The default implementation does nothing.

Parameters
dataA reference to the data array
Note
Subclasses override this if necessary

Definition at line 91 of file class.HierarchicalFormat.php.

Referenced by deserialize().

HierarchicalFormat::beforeSerialize ( $data)

Modify data before serialization. The default implementation does nothing.

Parameters
dataA reference to the data array
Note
Subclasses override this if necessary

Definition at line 98 of file class.HierarchicalFormat.php.

Referenced by serialize().

HierarchicalFormat::afterSerialize ( $data)

Modify data after serialization. The default implementation does nothing.

Parameters
dataA reference to the data array
Note
Subclasses override this if necessary

Definition at line 104 of file class.HierarchicalFormat.php.

Referenced by serialize().

HierarchicalFormat::isSerializedNode (   $key,
$value 
)

Determine if the value is a serialized Node. The default implementation returns false.

Parameters
keyThe data key
valueA reference to the data value
Returns
True/False
Note
Subclasses override this if necessary

Definition at line 114 of file class.HierarchicalFormat.php.

Referenced by processValues().

HierarchicalFormat::isDeserializedNode (   $key,
$value 
)

Determine if the value is a deserialized Node. The default implementation checks if the value is an object of type Node.

Parameters
keyThe data key
valueA reference to the data value
Returns
True/False
Note
Subclasses override this if necessary

Definition at line 126 of file class.HierarchicalFormat.php.

Referenced by processValues().

HierarchicalFormat::serializeNode (   $key,
$value 
)

Serialize a Node

Parameters
keyThe data key
valueA reference to the data value
Returns
The serialized Node

Definition at line 137 of file class.HierarchicalFormat.php.

References WCMFException\throwEx().

+ Here is the call graph for this function:

& HierarchicalFormat::deserializeNode (   $key,
$value 
)

Deserialize a Node

Parameters
keyThe data key
valueA reference to the data value
Returns
The deserialized Node

Definition at line 147 of file class.HierarchicalFormat.php.

References WCMFException\throwEx().

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: