NullFormat.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 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 
16 
17 /**
18  * NullFormat transfers the original request and response objects
19  * without modifying or transforming them.
20  *
21  * @author ingo herwig <ingo@wemove.com>
22  */
23 class NullFormat extends AbstractFormat {
24 
25  /**
26  * @see Format::getMimeType()
27  */
28  public function getMimeType(Response $response=null) {
29  return 'null';
30  }
31 
32  /**
33  * @see Format::isCached()
34  */
35  public function isCached(Response $response) {
36  return false;
37  }
38 
39  /**
40  * @see Format::getCacheDate()
41  */
42  public function getCacheDate(Response $response) {
43  return null;
44  }
45 
46  /**
47  * @see AbstractFormat::deserializeValues()
48  */
49  protected function deserializeValues(Request $request) {
50  return $request->getValues();
51  }
52 
53  /**
54  * @see AbstractFormat::serializeValues()
55  */
56  protected function serializeValues(Response $response) {
57  return $response->getValues();
58  }
59 }
60 ?>
Response holds the response values that are used as output from Controller instances.
Definition: Response.php:20
Request holds the request values that are used as input to Controller instances.
Definition: Request.php:18
getValues()
Get all key value pairs.
Format defines the interface for all format classes.
Definition: Format.php:25
NullFormat transfers the original request and response objects without modifying or transforming them...
Definition: NullFormat.php:23
AbstractFormat is used as base class for specialized formats.