public function directionFromRelation(Relationship $relation, Model $parent, Model $related)
    {
        // We will match the ids of the parent model and the start node of the relationship
        // and if they match we know that the direction is outgoing, incoming otherwise.
        $node = $relation->getStartNode();

        // We will start by considering the relationship direction to be 'incoming' until
        // we match and find otherwise.
        $direction = 'in';

        if ($node->getId() === $parent->getKey())
        {
            $direction = 'out';
        }

        return $direction;
    }
public function directionFromRelation(Relationship $relation, Model $parent, Model $related)
    {
        // We will match the ids of the parent model and the start node of the relationship
        // and if they match we know that the direction is outgoing, incoming otherwise.
        $node = $relation->getStartNode();

        // We will start by considering the relationship direction to be 'incoming' until
        // we match and find otherwise.
        $direction = 'in';

        if ($node->getId() === $parent->getKey())
        {
            $direction = 'out';
        }

        return $direction;
    }
public function directionFromRelation ( Relationship $ relation , Model $ parent , Model $ related ) { // We will match the ids of the parent model and the start node of the relationship // and if they match we know that the direction is outgoing, incoming otherwise. $ node = $ relation -> getStartNode ( ) ; // We will start by considering the relationship direction to be 'incoming' until // we match and find otherwise. $ direction = 'in' ; if ( $ node -> getId ( ) === $ parent -> getKey ( ) ) { $ direction = 'out' ; } return $ direction ; }
Get the direction of a relationship out of a Relation instance.

@param  \Everyman\Neo4j\Relationship $relation
@param  \Vinelab\NeoEloquent\Eloquent\Model        $parent
@param  \Vinelab\NeoEloquent\Eloquent\Model        $related
@return string Either 'in' or 'out'
Get the direction of a relationship out of a Relation instance .