Formatter.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  * Formatter is the single entry point for request/response formatting.
18  * It chooses the configured formatter based on the format property of the request
19  * by getting the value XXXFormat from the configuration section 'formats'.
20  *
21  * @author ingo herwig <ingo@wemove.com>
22  */
23 interface Formatter {
24 
25  /**
26  * Get the format name for the given mime type.
27  * @param $mimeType The mime type
28  * @return String
29  */
30  public function getFormatFromMimeType($mimeType);
31 
32  /**
33  * Deserialize Request data into objects.
34  * @param $request A reference to the Request instance
35  */
36  public function deserialize(Request $request);
37 
38  /**
39  * Serialize Response according to the output format.
40  * @param $response A reference to the Response instance
41  */
42  public function serialize(Response $response);
43 }
44 ?>
deserialize(Request $request)
Deserialize Request data into objects.
Response holds the response values that are used as output from Controller instances.
Definition: Response.php:20
Formatter is the single entry point for request/response formatting.
Definition: Formatter.php:23
getFormatFromMimeType($mimeType)
Get the format name for the given mime type.
Request holds the request values that are used as input to Controller instances.
Definition: Request.php:20
serialize(Response $response)
Serialize Response according to the output format.