[TASK] Streamline phpdoc annotations in EXT:extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / Response.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Mvc;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * A generic and very basic response implementation
19 */
20 class Response implements \TYPO3\CMS\Extbase\Mvc\ResponseInterface
21 {
22 /**
23 * @var string The response content
24 */
25 protected $content;
26
27 /**
28 * Overrides and sets the content of the response
29 *
30 * @param string $content The response content
31 */
32 public function setContent($content)
33 {
34 $this->content = $content;
35 }
36
37 /**
38 * Appends content to the already existing content.
39 *
40 * @param string $content More response content
41 */
42 public function appendContent($content)
43 {
44 $this->content .= $content;
45 }
46
47 /**
48 * Returns the response content without sending it.
49 *
50 * @return string The response content
51 */
52 public function getContent()
53 {
54 return $this->content;
55 }
56
57 /**
58 * Fetches the content, returns and clears it.
59 *
60 * @return string
61 */
62 public function shutdown()
63 {
64 $content = $this->getContent();
65 $this->setContent('');
66 return $content;
67 }
68
69 /**
70 * Returns the content of the response.
71 *
72 * @return string
73 */
74 public function __toString()
75 {
76 return $this->getContent();
77 }
78 }