Neos\Neos\Routing\FrontendNodeRoutePartHandler::resolveValue PHP Method

resolveValue() protected method

In order to render a suitable frontend URI, this function strips off the path to the site node and only keeps the actual node path relative to that site node. In practice this function would set $this->value as follows: absolute node path: /sites/neostypo3org/homepage/about $this->value: homepage/about absolute node path: /sites/neostypo3org/homepage/about@user-admin $this->value: homepage/about@user-admin
protected resolveValue ( mixed $node ) : boolean
$node mixed Either a Node object or an absolute context node path
return boolean true if value could be resolved successfully, otherwise false.
    protected function resolveValue($node)
    {
        if (!$node instanceof NodeInterface && !is_string($node)) {
            return false;
        }
        if (is_string($node)) {
            $nodeContextPath = $node;
            $contentContext = $this->buildContextFromPath($nodeContextPath, true);
            if ($contentContext->getWorkspace() === null) {
                return false;
            }
            $nodePath = $this->removeContextFromPath($nodeContextPath);
            $node = $contentContext->getNode($nodePath);
            if ($node === null) {
                return false;
            }
        } else {
            $contentContext = $node->getContext();
        }
        if (!$node->getNodeType()->isOfType('Neos.Neos:Document')) {
            return false;
        }
        $siteNode = $contentContext->getCurrentSiteNode();
        if ($this->onlyMatchSiteNodes() && $node !== $siteNode) {
            return false;
        }
        $routePath = $this->resolveRoutePathForNode($node);
        $this->value = $routePath;
        return true;
    }