Neos\Neos\Domain\Service\TypoScriptService::getMergedTypoScriptObjectTree PHP Method

getMergedTypoScriptObjectTree() public method

Returns a merged TypoScript object tree in the context of the given nodes
public getMergedTypoScriptObjectTree ( Neos\ContentRepository\Domain\Model\NodeInterface $startNode ) : array
$startNode Neos\ContentRepository\Domain\Model\NodeInterface Node marking the starting point
return array The merged object tree as of the given node
    public function getMergedTypoScriptObjectTree(NodeInterface $startNode)
    {
        $contentContext = $startNode->getContext();
        $siteResourcesPackageKey = $contentContext->getCurrentSite()->getSiteResourcesPackageKey();
        $siteRootTypoScriptPathAndFilename = sprintf($this->siteRootTypoScriptPattern, $siteResourcesPackageKey);
        $siteRootTypoScriptCode = $this->readExternalTypoScriptFile($siteRootTypoScriptPathAndFilename);
        if ($siteRootTypoScriptCode === '') {
            $siteRootTypoScriptPathAndFilename = sprintf($this->legacySiteRootTypoScriptPattern, $siteResourcesPackageKey);
            $siteRootTypoScriptCode = $this->readExternalTypoScriptFile($siteRootTypoScriptPathAndFilename);
        }
        $mergedTypoScriptCode = '';
        $mergedTypoScriptCode .= $this->generateNodeTypeDefinitions();
        $mergedTypoScriptCode .= $this->getTypoScriptIncludes($this->prepareAutoIncludeTypoScript());
        $mergedTypoScriptCode .= $this->getTypoScriptIncludes($this->prependTypoScriptIncludes);
        $mergedTypoScriptCode .= $siteRootTypoScriptCode;
        $mergedTypoScriptCode .= $this->getTypoScriptIncludes($this->appendTypoScriptIncludes);
        return $this->typoScriptParser->parse($mergedTypoScriptCode, $siteRootTypoScriptPathAndFilename);
    }