Neos\Neos\ViewHelpers\Rendering\AbstractRenderingStateViewHelper::getNodeContext PHP Method

getNodeContext() protected method

protected getNodeContext ( Neos\ContentRepository\Domain\Model\NodeInterface $node = null ) : ContentContext
$node Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\Neos\Domain\Service\ContentContext
    protected function getNodeContext(NodeInterface $node = null)
    {
        if ($node === null) {
            $node = $this->getContextNode();
            if ($node === null) {
                throw new ViewHelperException('The ' . get_class($this) . ' needs a Node to determine the state. We could not find one in your context so please provide it as "node" argument to the ViewHelper.', 1427267133);
            }
        }
        $context = $node->getContext();
        if (!$context instanceof ContentContext) {
            throw new ViewHelperException('Rendering state can only be obtained with Nodes that are in a Neos ContentContext. Please provide a Node with such a context.', 1427720037);
        }
        return $context;
    }
AbstractRenderingStateViewHelper