public function inject(&$page, $theme)
    {
        $contextes = [
            ContextManager::CONTEXT_PAGE => $this->contextManager->getPageContext(),
            ContextManager::CONTEXT_SITE => $this->contextManager->getSiteContext()
        ];

        // Preload all node at onces
        foreach ($contextes as $contextType => $context) {
            $this->collectNodeIdList($context, $this->contextManager->getThemeRegionConfigFor($theme, $contextType));
        }
        if ($this->nidList) {
            $this->nodes = $this->entityManager->getStorage('node')->loadMultiple($this->nidList);
        }

        foreach ($contextes as $contextType => $context) {
            $this->processContext($page, $theme, $context, $contextType);
        }
    }
public function inject(&$page, $theme)
    {
        $contextes = [
            ContextManager::CONTEXT_PAGE => $this->contextManager->getPageContext(),
            ContextManager::CONTEXT_SITE => $this->contextManager->getSiteContext()
        ];

        // Preload all node at onces
        foreach ($contextes as $contextType => $context) {
            $this->collectNodeIdList($context, $this->contextManager->getThemeRegionConfigFor($theme, $contextType));
        }
        if ($this->nidList) {
            $this->nodes = $this->entityManager->getStorage('node')->loadMultiple($this->nidList);
        }

        foreach ($contextes as $contextType => $context) {
            $this->processContext($page, $theme, $context, $contextType);
        }
    }
public function inject ( & $ page , $ theme ) { $ contextes = [ ContextManager :: CONTEXT_PAGE => $ this -> contextManager -> getPageContext ( ) , ContextManager :: CONTEXT_SITE => $ this -> contextManager -> getSiteContext ( ) ] ; // Preload all node at onces foreach ( $ contextes as $ contextType => $ context ) { $ this -> collectNodeIdList ( $ context , $ this -> contextManager -> getThemeRegionConfigFor ( $ theme , $ contextType ) ) ; } if ( $ this -> nidList ) { $ this -> nodes = $ this -> entityManager -> getStorage ( 'node' ) -> loadMultiple ( $ this -> nidList ) ; } foreach ( $ contextes as $ contextType => $ context ) { $ this -> processContext ( $ page , $ theme , $ context , $ contextType ) ; } }
Inject given regions into the given page

@param array $page
Inject given regions into the given page