_getDataObj()->setFilter('pageId', $this->_doc->getOption('id'))->getList(); $hydrator = new Hydrator(false); foreach ($list as $item) { /** @var Entity $entity */ $entity = $hydrator->hydrate($item, new Entity()); $this->executeSideBlock($entity); } if (Qs_Constant::get('DEBUG')) { Zend_Registry::set('_pageSideBlocks', $list); } return $this; } protected function executeSideBlock(Entity $block) { if (!($controllerClass = $this->_getDataObj()->getType($block->getType(), 'controller')) || !class_exists($controllerClass) ) { trigger_error( 'Side block controller "' . $controllerClass . '" not found (Side Block ID=' . $block->getId() . ').', E_USER_WARNING ); return $this; } /** @var SideBlockAwareInterface|Qs_ViewController $controller */ $controller = new $controllerClass(['doc' => $this->_doc]); if (!($controller instanceof SideBlockAwareInterface)) { trigger_error( $controllerClass . ' side block controller doesn\'t implement SideBlockAwareInterface.', E_USER_WARNING ); return $this; } $controller->setSideBlock($block); $controller->setGroupName($block->getGroupName()); /** @var Qs_ViewController $controller */ $controller->exec(); return $this; } }