{@inheritdoc}

@return \Ems\Contracts\Graphics\LayoutItem|null
972563
public function getItem($row, $column)
    {
        if (isset($this->_layout[$row][$column])) {
            return $this->_layout[$row][$column];
        }
        return null;
    }
1178866
public function renderItem(&$node)
    {
        $type = $node[0];
        $item = $this->loadItemType($type);

        if ($item === false) {
            return null;
        }

        return $item->render($node);
    }
116785
public function getLayout()
    {
        if (! $this->layout) {
            $layout = new ViewModel();
            $layout->setTemplate('layout/layout');
            $this->layout = $layout;
        }

        return $this->layout;
    }
300956
protected function getThemeAssistantStylesheet()
	{
		if (!$GLOBALS['objPage'] || !$GLOBALS['objPage']->getRelated('layout')) {
			return null;
		}
		if (!$stylesheets = $GLOBALS['objPage']->getRelated('layout')->external) {
			return null;
		}

		$stylesheets = \StringUtil::deserialize($stylesheets);
		foreach ($stylesheets as $stylesheet) {
			$file = \FilesModel::findByUuid($stylesheet);
			if ($file && $file->path && file_exists(TL_ROOT . '/' . $file->path . '.base')) {
				return $file->path . '.base';
			}
		}

		return null;
	}
1207410
protected function getLayoutIdentifier($layoutName = 'Default')
    {
        $layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
        $prefix = 'layout_' . $layoutName;
        return $this->createIdentifierForFile($layoutPathAndFilename, $prefix);
    }
1264224
public function findComponentByHandler($handler)
    {
        foreach ($this->page->components as $component) {
            if ($component->methodExists($handler)) {
                return $component;
            }
        }

        foreach ($this->layout->components as $component) {
            if ($component->methodExists($handler)) {
                return $component;
            }
        }

        return null;
    }
1359116
protected function NextItem()
	{
		/**
		 * @var \XBRL $taxonomy
		 */
		$taxonomy = $this->context->xbrlTaxonomy;

		$memberPathPartsCount = count( explode( "/", $this->memberPath ) );

		while ( true )
		{
			if ( is_null( $this->candidates ) || ! is_array( $this->candidates ) || $this->index >= count( $this->candidates ) )
			{
				return null;
			}

			$candidaterPath = $this->candidates[ $this->index++ ];
			$candidaterPathParts = explode( "/", $candidaterPath );

			if ( $this->axis == "DRS-child" )
			{
				// The member at the index can only be child.
				// That is, the count of parts can only be the same as $memberPathPartsCount or just one greater
				if ( count( $candidaterPathParts ) > $memberPathPartsCount + 1 )
				{
					continue;
				}
			}

			$member = $candidaterPathParts[ count( $candidaterPathParts ) - 1 ];
			$memTaxonomy = $taxonomy->getTaxonomyForXSD( $member );
			$memberId = trim( strrchr( $member, "#"), "#" );
			$memElement = $memTaxonomy->getElementById( $memberId );
			$result = QNameValue::fromNCName( "{$memTaxonomy->getPrefix()}:{$memElement['name']}", $this->context->NamespaceManager );

			return $result;

		}

		return null;
	}
1172040
private function ParentItem()
    {
        $this->parent = $this->GetTreeItem('parent');
        return $this->parent->Exists() ? $this->parent : null;
    }
82701
public function renderLayout(array $data = null)
    {
        !$data or extract($data);
        ob_start();

        /** @noinspection PhpIncludeInspection */
        if (file_exists(rtrim(
                $this->getLayoutPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            include rtrim(
                    $this->getLayoutPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } elseif (file_exists(rtrim(
                $this->getLayoutFallbackPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            include rtrim(
                    $this->getLayoutFallbackPath(), $this->getFileExt()
                ) . $this->getFileExt();
        } else {

            throw new ViewNotFoundException('View ' . rtrim(
                    $this->getLayoutPath(), $this->getFileExt()
                ) . $this->getFileExt() . ' not found');
        }

        $rendered = ob_get_contents();
        ob_end_clean();

        return $rendered;
    }
517430
public function layoutPath($path = null)
    {
        deprecationWarning('ViewBuilder::layoutPath() is deprecated. Use ViewBuilder::setLayoutPath() or ViewBuilder::getLayoutPath() instead.');
        if ($path !== null) {
            return $this->setLayoutPath($path);
        }

        return $this->getLayoutPath();
    }
1109984
public function setLayout($layout = null)
    {
        if (null !== $layout && !is_string($layout) && !($layout instanceof ViewModel)) {
            throw new InvalidArgumentException(
                'Invalid value supplied for setLayout.'.
                'Expected null, string, or Zend\View\Model\ViewModel.'
            );
        }

        if (null === $layout && empty($this->config['message']['layout'])) {
            return;
        }

        if (null === $layout) {
            $layout = (string) $this->config['message']['layout'];

            unset($this->config['message']['layout']);
        }

        if (is_string($layout)) {

            $template   = $layout;
            $layout     = new ViewModel;

            $layout->setTemplate($template);
        }

        $this->layout = $layout;
    }
434498
public function getLayoutPath( $sufix = 'layouts' )
	{
		if( $this->_layoutPath === null ) {
			
			$path = parent::getLayoutPath();
			
			if( !is_dir( $path ) && $parentPath = $this->getParentPath( $sufix ) ) {
				
				$path = $parentPath;
				
			}
			
			$this->_layoutPath = $path;
		}
		
		return $this->_layoutPath;
	}
406636
public function getCurrentLayout()
    {
        if (!$this->layout && $this->layoutNodeId) {
            $this->layout = $this->getStorage()->findForNodeOnSite($this->layoutNodeId, $this->layoutSiteId, true);
        }

        return $this->layout;
    }
449015
public function getLayoutId(): \Psr\Http\Message\UriInterface
    {
        if (!$this->layoutId) {
            return new Uri();
        }

        return $this->layoutId;
    }
936206
public function getLayoutBlock($zone = null)
    {
        if (!is_null($zone)) {
            $layoutBlocks = $this->layoutBlock->filter(
                function ($layoutBlock) use ($zone) {
                    return $layoutBlock->getZone() == $zone && $layoutBlock->isActive();
                }
            );

            return array_merge($layoutBlocks->toArray());
        }

        return $this->layoutBlock;
    }
828290
function layout($tpl = null) {
        //        $template = explode('::', $as);
        //        if (count($template) > 1) {
        //            $namespace = Arr::get($template, 0);
        //            if (substr_count($namespace, '-') && substr_count(Arr::get($template, 1), '.')) {
        //                $package   = explode('.', Arr::get($template, 1), 3);
        //                $end       = Arr::get($package, 2, "");
        //                if ($end) {
        //                    $end = '.' . $end;
        //                }
        //                $package = Arr::get($package, 1) . '.' . Arr::get($package, 0) . $end;
        //
        //                $as = $namespace . '::' . trim($package, '.');
        //                dd($as );
        //            }
        //        }
        if (true === $tpl) {
            $this->layout = \Route::currentRouteName();
        } elseif (null !== $tpl) {
            $this->layout = $tpl;
        }
        //        dd($this->layout);

        return $this;
    }
534305
public function getLayout($media)
	{
		throw new \Exception('Do not use me.');

		$layout = null;
		$trace = array();
		
		foreach ($this as $abstractPage) {
			if ($abstractPage instanceof Template) {
				if ($abstractPage->hasLayout($media)) {
					$layout = $abstractPage->getLayout($media);
				}
			}

			$trace[] = (string) $abstractPage;
		}
		
		return $layout;
	}