Neos\Neos\Routing\FrontendNodeRoutePartHandler::matchValue PHP Method

matchValue() protected method

This function tries to find a matching node by the given request path. If one was found, its absolute context node path is set in $this->value and true is returned. Note that this matcher does not check if access to the resolved workspace or node is allowed because at the point in time the route part handler is invoked, the security framework is not yet fully initialized.
protected matchValue ( string $requestPath ) : boolean
$requestPath string The request path (without leading "/", relative to the current Site Node)
return boolean true if the $requestPath could be matched, otherwise false
    protected function matchValue($requestPath)
    {
        try {
            /** @var NodeInterface $node */
            $node = null;
            // Build context explicitly without authorization checks because the security context isn't available yet
            // anyway and any Entity Privilege targeted on Workspace would fail at this point:
            $this->securityContext->withoutAuthorizationChecks(function () use(&$node, $requestPath) {
                $node = $this->convertRequestPathToNode($requestPath);
            });
        } catch (Exception $exception) {
            $this->systemLogger->log('FrontendNodeRoutePartHandler matchValue(): ' . $exception->getMessage(), LOG_DEBUG);
            if ($requestPath === '') {
                throw new Exception\NoHomepageException('Homepage could not be loaded. Probably you haven\'t imported a site yet', 1346950755, $exception);
            }
            return false;
        }
        if ($this->onlyMatchSiteNodes() && $node !== $node->getContext()->getCurrentSiteNode()) {
            return false;
        }
        $this->value = $node->getContextPath();
        return true;
    }