TYPO3 CMS  TYPO3_6-2
ResponseContent.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $sections;
26 
30  protected $structure;
31 
35  protected $structurePaths;
36 
40  protected $records;
41 
45  protected $queries;
46 
50  public function __construct(Response $response) {
51  $content = json_decode($response->getContent(), TRUE);
52 
53  if ($content !== NULL && is_array($content)) {
54  foreach ($content as $sectionIdentifier => $sectionData) {
55  $section = new ResponseSection($sectionIdentifier, $sectionData);
56  $this->sections[$sectionIdentifier] = $section;
57  }
58  }
59  }
60 
66  public function getSection($sectionIdentifier) {
67  if (isset($this->sections[$sectionIdentifier])) {
68  return $this->sections[$sectionIdentifier];
69  }
70 
71  throw new \RuntimeException('ResponseSection "' . $sectionIdentifier . '" does not exist');
72  }
73 
74 }