public function getOutboundEdges($model, $label = null, $aql = "", $params = array(), $placeholder = "doc")
    {
        $id = $this->getVertexId($model);

        if (!$id) {
            return array();
        }

        $collectionParameter = $this->_toolbox->generateBindingParameter('@collection', $params);
        $vertexParameter = $this->_toolbox->generateBindingParameter('vertexid', $params);
        $directionParameter = $this->_toolbox->generateBindingParameter('direction', $params);

        if (!$label) {
            $query = "FOR $placeholder in EDGES(@$collectionParameter, @$vertexParameter, @$directionParameter) " . $aql . " return $placeholder";
        } else {
            $labelParameter = $this->_toolbox->generateBindingParameter('label', $params);
            $params[$labelParameter] = $label;
            $query = "FOR $placeholder in EDGES(@$collectionParameter, @$vertexParameter, @$directionParameter, [{'\$label': @$labelParameter}]) " . $aql . " return $placeholder";
        }

        $params[$collectionParameter] = $this->_toolbox->getEdgeCollectionName();
        $params[$vertexParameter] = $id;
        $params[$directionParameter] = "outbound";

        if ($this->_toolbox->getTransactionManager()->hasTransaction()) {
            $this->_toolbox->getTransactionManager()->addReadCollection($this->_toolbox->getEdgeCollectionName());
            $statement = json_encode(array('query' => $query, 'bindVars' => $params), JSON_FORCE_OBJECT);
            $this->_toolbox->getTransactionManager()->addCommand("db._createStatement($statement).execute().elements();", "GraphManager:getOutboundEdges", null, true);

        } else {
            try {
                $result = $this->_toolbox->getQuery()->getAll($query, $params);
            } catch (\Exception $e) {
                throw new GraphManagerException($e->getMessage(), $e->getCode());
            }

            if (empty($result)) {
                return array();
            }

            return $this->convertToPods("edge", $result);
        }
    }
public function getOutboundEdges($model, $label = null, $aql = "", $params = array(), $placeholder = "doc")
    {
        $id = $this->getVertexId($model);

        if (!$id) {
            return array();
        }

        $collectionParameter = $this->_toolbox->generateBindingParameter('@collection', $params);
        $vertexParameter = $this->_toolbox->generateBindingParameter('vertexid', $params);
        $directionParameter = $this->_toolbox->generateBindingParameter('direction', $params);

        if (!$label) {
            $query = "FOR $placeholder in EDGES(@$collectionParameter, @$vertexParameter, @$directionParameter) " . $aql . " return $placeholder";
        } else {
            $labelParameter = $this->_toolbox->generateBindingParameter('label', $params);
            $params[$labelParameter] = $label;
            $query = "FOR $placeholder in EDGES(@$collectionParameter, @$vertexParameter, @$directionParameter, [{'\$label': @$labelParameter}]) " . $aql . " return $placeholder";
        }

        $params[$collectionParameter] = $this->_toolbox->getEdgeCollectionName();
        $params[$vertexParameter] = $id;
        $params[$directionParameter] = "outbound";

        if ($this->_toolbox->getTransactionManager()->hasTransaction()) {
            $this->_toolbox->getTransactionManager()->addReadCollection($this->_toolbox->getEdgeCollectionName());
            $statement = json_encode(array('query' => $query, 'bindVars' => $params), JSON_FORCE_OBJECT);
            $this->_toolbox->getTransactionManager()->addCommand("db._createStatement($statement).execute().elements();", "GraphManager:getOutboundEdges", null, true);

        } else {
            try {
                $result = $this->_toolbox->getQuery()->getAll($query, $params);
            } catch (\Exception $e) {
                throw new GraphManagerException($e->getMessage(), $e->getCode());
            }

            if (empty($result)) {
                return array();
            }

            return $this->convertToPods("edge", $result);
        }
    }
public function getOutboundEdges ( $ model , $ label = null , $ aql = "" , $ params = array ( ) , $ placeholder = "doc" ) { $ id = $ this -> getVertexId ( $ model ) ; if ( ! $ id ) { return array ( ) ; } $ collectionParameter = $ this -> _toolbox -> generateBindingParameter ( '@collection' , $ params ) ; $ vertexParameter = $ this -> _toolbox -> generateBindingParameter ( 'vertexid' , $ params ) ; $ directionParameter = $ this -> _toolbox -> generateBindingParameter ( 'direction' , $ params ) ; if ( ! $ label ) { $ query = "FOR $placeholder in EDGES(@$collectionParameter, @$vertexParameter, @$directionParameter) " . $ aql . " return $placeholder" ; } else { $ labelParameter = $ this -> _toolbox -> generateBindingParameter ( 'label' , $ params ) ; $ params [ $ labelParameter ] = $ label ; $ query = "FOR $placeholder in EDGES(@$collectionParameter, @$vertexParameter, @$directionParameter, [{'\$label': @$labelParameter}]) " . $ aql . " return $placeholder" ; } $ params [ $ collectionParameter ] = $ this -> _toolbox -> getEdgeCollectionName ( ) ; $ params [ $ vertexParameter ] = $ id ; $ params [ $ directionParameter ] = "outbound" ; if ( $ this -> _toolbox -> getTransactionManager ( ) -> hasTransaction ( ) ) { $ this -> _toolbox -> getTransactionManager ( ) -> addReadCollection ( $ this -> _toolbox -> getEdgeCollectionName ( ) ) ; $ statement = json_encode ( array ( 'query' => $ query , 'bindVars' => $ params ) , JSON_FORCE_OBJECT ) ; $ this -> _toolbox -> getTransactionManager ( ) -> addCommand ( "db._createStatement($statement).execute().elements();" , "GraphManager:getOutboundEdges" , null , true ) ; } else { try { $ result = $ this -> _toolbox -> getQuery ( ) -> getAll ( $ query , $ params ) ; } catch ( \ Exception $ e ) { throw new GraphManagerException ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } if ( empty ( $ result ) ) { return array ( ) ; } return $ this -> convertToPods ( "edge" , $ result ) ; } }
Get all outbound edges to this vertex. The edges can be filtered by their labels and AQL.
@param Document|Model|string A vertex pod, model or string of the vertex id.
@param  string $label       A string representing one label or an array of labels we want the inbound edges to have.
@param  string $aql         An optional AQL fragment if we want to filter the edges, for example: FILTER doc.someproperty == "somevalue"
@param  array  $params      An optional associative array containing parameters to bind to the query.
@param  string $placeholder Set this to something else if you do not wish to use "doc" to refer to documents in your query.
@return array
Get all outbound edges to this vertex . The edges can be filtered by their labels and AQL .