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