Format.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
15 
16 /**
17  * Format defines the interface for all format classes. Format instances
18  * are used to map external data representations like JSON, XML/SOAP or HTML
19  * to internal ones. All data values are supposed to be scalar or array values
20  * except for Nodes, for which each external representation defines a special notation.
21  *
22  * @author ingo herwig <ingo@wemove.com>
23  */
24 interface Format {
25 
26  /**
27  * Get the MIME type of the format
28  * @return String
29  */
30  public function getMimeType();
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  public function deserialize(Request $request);
37 
38  /**
39  * Serialize Response data according to the external representation.
40  * @param $response A reference to the Response instance
41  */
42  public function serialize(Response $response);
43 }
44 ?>
Response holds the response values that are used as output from Controller instances.
Definition: Response.php:20
serialize(Response $response)
Serialize Response data according to the external representation.
deserialize(Request $request)
Deserialize Request data from the external representation into Nodes and scalars/arrays.
getMimeType()
Get the MIME type of the format.
Request holds the request values that are used as input to Controller instances.
Definition: Request.php:20
Format defines the interface for all format classes.
Definition: Format.php:24