TYPO3 CMS  TYPO3_6-2
Response.php
Go to the documentation of this file.
1 <?php
3 
20 class Response {
21 
22  const STATUS_Success = 'success';
23  const STATUS_Failure = 'failure';
24 
28  protected $status;
29 
33  protected $content;
34 
38  protected $error;
39 
43  protected $responseSection;
44 
50  public function __construct($status, $content, $error) {
51  $this->status = $status;
52  $this->content = $content;
53  $this->error = $error;
54  }
55 
59  public function getStatus() {
60  return $this->status;
61  }
62 
66  public function getContent() {
67  return $this->content;
68  }
69 
73  public function getError() {
74  return $this->error;
75  }
76 
80  public function getResponseContent() {
81  if (!isset($this->responseContent)) {
82  $this->responseContent = new ResponseContent($this);
83  }
84  return $this->responseContent;
85  }
86 
90  public function getResponseSections() {
91  $sectionIdentifiers = func_get_args();
92 
93  if (empty($sectionIdentifiers)) {
94  $sectionIdentifiers = array('Default');
95  }
96 
97  $sections = array();
98  foreach ($sectionIdentifiers as $sectionIdentifier) {
99  $sections[] = $this->getResponseContent()->getSection($sectionIdentifier);
100  }
101 
102  return $sections;
103  }
104 
105 }