public function edgeFromRelationWithDirection(Relationship $relation, Model $parent, Model $related, $direction)
    {
        // If the direction is of type 'any' we need to figure out the relationship direction
        // from the determined relation.
        if ($direction == 'any')
        {
            $direction = $this->directionFromRelation($relation, $parent, $related);
        }

        // Based on the direction we are now able to construct the edge class name and call for
        // an instance of it then pass it the actual relationship that was previously found.
        $class = $this->getEdgeClass($direction);
        $edge = new $class($this->query, $parent, $related, $relation->getType());
        $edge->setRelation($relation, true);

        return $edge;
    }
public function edgeFromRelationWithDirection(Relationship $relation, Model $parent, Model $related, $direction)
    {
        // If the direction is of type 'any' we need to figure out the relationship direction
        // from the determined relation.
        if ($direction == 'any')
        {
            $direction = $this->directionFromRelation($relation, $parent, $related);
        }

        // Based on the direction we are now able to construct the edge class name and call for
        // an instance of it then pass it the actual relationship that was previously found.
        $class = $this->getEdgeClass($direction);
        $edge = new $class($this->query, $parent, $related, $relation->getType());
        $edge->setRelation($relation, true);

        return $edge;
    }
public function edgeFromRelationWithDirection ( Relationship $ relation , Model $ parent , Model $ related , $ direction ) { // If the direction is of type 'any' we need to figure out the relationship direction // from the determined relation. if ( $ direction == 'any' ) { $ direction = $ this -> directionFromRelation ( $ relation , $ parent , $ related ) ; } // Based on the direction we are now able to construct the edge class name and call for // an instance of it then pass it the actual relationship that was previously found. $ class = $ this -> getEdgeClass ( $ direction ) ; $ edge = new $ class ( $ this -> query , $ parent , $ related , $ relation -> getType ( ) ) ; $ edge -> setRelation ( $ relation , true ) ; return $ edge ; }
Get the Edge instance out of a Relationship based on a direction.

@param  \Everyman\Neo4j\Relationship $relation
@param  string $direction
@return \Vinelab\NeoEloquent\Eloquent\Edges\Edge[In|Out]
Get the Edge instance out of a Relationship based on a direction .