Neos\Neos\Fusion\ContentElementWrappingImplementation::evaluate PHP Method

evaluate() public method

Evaluate this TypoScript object and return the result
public evaluate ( ) : mixed
return mixed
    public function evaluate()
    {
        $content = $this->getValue();
        /** @var $node NodeInterface */
        $node = $this->tsValue('node');
        if (!$node instanceof NodeInterface) {
            return $content;
        }
        /** @var $contentContext ContentContext */
        $contentContext = $node->getContext();
        if ($contentContext->getWorkspaceName() === 'live') {
            return $content;
        }
        if (!$this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess')) {
            return $content;
        }
        if ($node->isRemoved()) {
            $content = '';
        }
        if ($this->tsValue('renderCurrentDocumentMetadata')) {
            return $this->contentElementWrappingService->wrapCurrentDocumentMetadata($node, $content, $this->getContentElementTypoScriptPath());
        }
        return $this->contentElementWrappingService->wrapContentObject($node, $content, $this->getContentElementTypoScriptPath());
    }