/** * Getter and lazy loader for reader context * * @return Layout\Reader\Context */ public function getReaderContext() { if (!$this->readerContext) { $this->readerContext = $this->readerContextFactory->create(); } return $this->readerContext; }
/** * @param Layout\ProcessorFactory $processorFactory * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param Layout\Data\Structure $structure * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param Design\Theme\ResolverInterface $themeResolver * @param Layout\ReaderPool $readerPool * @param Layout\GeneratorPool $generatorPool * @param FrontendInterface $cache * @param Layout\Reader\ContextFactory $readerContextFactory * @param Layout\Generator\ContextFactory $generatorContextFactory * @param bool $cacheable */ public function __construct(Layout\ProcessorFactory $processorFactory, ManagerInterface $eventManager, Layout\Data\Structure $structure, MessageManagerInterface $messageManager, Design\Theme\ResolverInterface $themeResolver, Layout\ReaderPool $readerPool, Layout\GeneratorPool $generatorPool, FrontendInterface $cache, Layout\Reader\ContextFactory $readerContextFactory, Layout\Generator\ContextFactory $generatorContextFactory, $cacheable = true) { $this->_elementClass = 'Magento\\Framework\\View\\Layout\\Element'; $this->setXml(simplexml_load_string('<layout/>', $this->_elementClass)); $this->_renderingOutput = new \Magento\Framework\Object(); $this->_processorFactory = $processorFactory; $this->_eventManager = $eventManager; $this->structure = $structure; $this->messageManager = $messageManager; $this->themeResolver = $themeResolver; $this->readerPool = $readerPool; $this->generatorPool = $generatorPool; $this->cacheable = $cacheable; $this->cache = $cache; $this->readerContextFactory = $readerContextFactory; $this->generatorContextFactory = $generatorContextFactory; $this->readerContext = $this->readerContextFactory->create(); }