public function getPlaceHolderSet() { if ($this->placeHolderSet) { return $this->placeHolderSet; } parent::getPlaceHolderSet(); $this->createMissingPlaceHolders(); return $this->placeHolderSet; }
/** * Creates placeholder response objects with collected block responses. * * @return PlaceHolderResponse[] */ protected function createPlaceResponses() { $placeResponses = array(); $placeHolders = $this->pageRequest->getPlaceHolderSet(); foreach ($placeHolders->getFinalPlaceHolders() as $name => $placeHolder) { $placeResponses[$name] = $this->createPlaceResponse($placeHolder); } $this->iterateBlocks(function (Block $block, BlockController $blockController) use(&$placeResponses) { /* @var $placeResponses PlaceHolderResponse[] */ $response = $blockController->getResponse(); $placeName = $block->getPlaceHolder()->getName(); if (!isset($placeResponses[$placeName])) { throw new \LogicException("Logic problem – final place holder by name [{$placeName}] is not found."); } $placeResponses[$placeName]->output($response); }); return $placeResponses; }