src/Twig/NcrExtension.php
public function getNode($ref): ?Node
    {
        $nodeRef = $this->toNodeRef($ref);
        if (!$nodeRef instanceof NodeRef) {
            return null;
        }

        try {
            return $this->ncrCache->getNode($nodeRef);
        } catch (NodeNotFound $e) {
            return null;
        } catch (\Throwable $e) {
            if ($this->debug) {
                throw $e;
            }

            $this->logger->error(
                sprintf(
                    '%s::Unable to process twig "ncr_get_node" function for [{node_ref}].',
                    ClassUtils::getShortName($e)
                ),
                ['exception' => $e, 'node_ref' => (string)$nodeRef]
            );
        }

        return null;
    }
public function getNode($ref): ?Node
    {
        $nodeRef = $this->toNodeRef($ref);
        if (!$nodeRef instanceof NodeRef) {
            return null;
        }

        try {
            return $this->ncrCache->getNode($nodeRef);
        } catch (NodeNotFound $e) {
            return null;
        } catch (\Throwable $e) {
            if ($this->debug) {
                throw $e;
            }

            $this->logger->error(
                sprintf(
                    '%s::Unable to process twig "ncr_get_node" function for [{node_ref}].',
                    ClassUtils::getShortName($e)
                ),
                ['exception' => $e, 'node_ref' => (string)$nodeRef]
            );
        }

        return null;
    }
public function getNode ( $ ref ) : ? Node { $ nodeRef = $ this -> toNodeRef ( $ ref ) ; if ( ! $ nodeRef instanceof NodeRef ) { return null ; } try { return $ this -> ncrCache -> getNode ( $ nodeRef ) ; } catch ( NodeNotFound $ e ) { return null ; } catch ( \ Throwable $ e ) { if ( $ this -> debug ) { throw $ e ; } $ this -> logger -> error ( sprintf ( '%s::Unable to process twig "ncr_get_node" function for [{node_ref}].' , ClassUtils :: getShortName ( $ e ) ) , [ 'exception' => $ e , 'node_ref' => ( string ) $ nodeRef ] ) ; } return null ; }
Gets a node from the NcrCache service if it's available.
This will NOT make a new request to fetch a node, it must
have already been loaded to NcrCache.

@param NodeRef|MessageRef|string $ref

@return Node

@throws \Throwable
Gets a node from the NcrCache service if it s available . This will NOT make a new request to fetch a node it must have already been loaded to NcrCache .