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);
}