Neos.ContentRepository/Classes/Domain/Model/Node.php
public function findReferencedNodes(): TraversableNodes
    {
        $referencedNodes = [];
        foreach ($this->getNodeType()->getProperties() as $propertyName => $property) {
            $propertyType = $this->getNodeType()->getPropertyType($propertyName);
            if ($propertyType === 'reference' && $this->getProperty($propertyName) instanceof TraversableNodeInterface) {
                $referencedNodes[] = $this->getProperty($propertyName);
            } elseif ($propertyName === 'references' && !empty($this->getProperty($propertyName))) {
                foreach ($this->getProperty($propertyName) as $node) {
                    if ($node instanceof TraversableNodeInterface) {
                        $referencedNodes[] = $node;
                    }
                }
            }
        }

        return TraversableNodes::fromArray($referencedNodes);
    }
public function findReferencedNodes(): TraversableNodes
    {
        $referencedNodes = [];
        foreach ($this->getNodeType()->getProperties() as $propertyName => $property) {
            $propertyType = $this->getNodeType()->getPropertyType($propertyName);
            if ($propertyType === 'reference' && $this->getProperty($propertyName) instanceof TraversableNodeInterface) {
                $referencedNodes[] = $this->getProperty($propertyName);
            } elseif ($propertyName === 'references' && !empty($this->getProperty($propertyName))) {
                foreach ($this->getProperty($propertyName) as $node) {
                    if ($node instanceof TraversableNodeInterface) {
                        $referencedNodes[] = $node;
                    }
                }
            }
        }

        return TraversableNodes::fromArray($referencedNodes);
    }
public function findReferencedNodes ( ) : TraversableNodes { $ referencedNodes = [ ] ; foreach ( $ this -> getNodeType ( ) -> getProperties ( ) as $ propertyName => $ property ) { $ propertyType = $ this -> getNodeType ( ) -> getPropertyType ( $ propertyName ) ; if ( $ propertyType === 'reference' && $ this -> getProperty ( $ propertyName ) instanceof TraversableNodeInterface ) { $ referencedNodes [ ] = $ this -> getProperty ( $ propertyName ) ; } elseif ( $ propertyName === 'references' && ! empty ( $ this -> getProperty ( $ propertyName ) ) ) { foreach ( $ this -> getProperty ( $ propertyName ) as $ node ) { if ( $ node instanceof TraversableNodeInterface ) { $ referencedNodes [ ] = $ node ; } } } } return TraversableNodes :: fromArray ( $ referencedNodes ) ; }
Retrieves and returns all nodes referenced by this node from its subgraph.

@return TraversableNodes
@throws NodeException
@throws NodeTypeNotFoundException
@throws \Neos\Flow\Property\Exception
@throws \Neos\Flow\Security\Exception
Retrieves and returns all nodes referenced by this node from its subgraph .