wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.IFormat.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: class.IFormat.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 
20 /**
21  * @class IFormat
22  * @ingroup Format
23  * @brief IFormat defines the interface for all formatter classes. Formatter
24  * classes are used to map external data representations like JSON, XML/SOAP or HTML
25  * to internal ones. All data values are supposed to be scalar or array values
26  * except for Nodes, for which each external representation defines a special notation.
27  *
28  * @author ingo herwig <ingo@wemove.com>
29  */
30 class IFormat
31 {
32  /**
33  * Deserialize Request data from the external representation into Nodes and scalars/arrays.
34  * @param request A reference to the Request instance
35  */
36  function deserialize(&$request)
37  {
38  WCMFException::throwEx("deserialize() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
39  }
40  /**
41  * Serialize Response data according to the external representation.
42  * @param response A reference to the Response instance
43  */
44  function serialize(&$response)
45  {
46  WCMFException::throwEx("serialize() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
47  }
48 }
49 ?>
deserialize(&$request)
IFormat defines the interface for all formatter classes. Formatter classes are used to map external d...
throwEx($message, $file='', $line='')
serialize(&$response)