public function getVertexCollections($graph, array $options = [])
    {
        if ($graph instanceof Graph) {
            $graph = $graph->getKey();
        }

        $excludeOrphans = false;
        $_useCache      = $this->cacheEnabled;

        if ((bool) $options && isset($options['excludeOrphans']) && !is_bool($options['excludeOrphans'])) {
            $excludeOrphans = UrlHelper::getBoolString($options['excludeOrphans']);
        }

        if ($_useCache === true) {
            if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['result'])) {
                return $this->cache[$graph]['excludeOrphans']['vertexCollections'];
            }

            if (!empty($this->cache[$graph]['vertexCollections'])) {
                return $this->cache[$graph]['vertexCollections'];
            }
        }
        $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);

        if ($excludeOrphans === true) {
            $url = UrlHelper::appendParamsUrl($url, ['excludeOrphans' => $excludeOrphans]);
        }

        $connection       = $this->getConnection();
        $batchCaptureMode = $connection->isInBatchCaptureMode();

        if ($batchCaptureMode === true) {
            $this->getConnection()->setBatchRequest(false);
        }

        try {
            $response = $this->getConnection()->get($url);
        } catch (Exception $e) {
            throw new ClientException($e->getMessage());
        }

        if ($batchCaptureMode === true) {
            $this->getConnection()->setBatchRequest(true);
        }

        $data = $response->getJson();
        $data = $data[self::OPTION_COLLECTIONS];

        sort($data);

        if ($_useCache === true) {
            if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['vertexCollections'])) {
                $this->cache[$graph]['excludeOrphans']['vertexCollections'] = $data;
            } else {
                $this->cache[$graph]['vertexCollections'] = $data;
            }
        }

        return $data;
    }
public function getVertexCollections($graph, array $options = [])
    {
        if ($graph instanceof Graph) {
            $graph = $graph->getKey();
        }

        $excludeOrphans = false;
        $_useCache      = $this->cacheEnabled;

        if ((bool) $options && isset($options['excludeOrphans']) && !is_bool($options['excludeOrphans'])) {
            $excludeOrphans = UrlHelper::getBoolString($options['excludeOrphans']);
        }

        if ($_useCache === true) {
            if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['result'])) {
                return $this->cache[$graph]['excludeOrphans']['vertexCollections'];
            }

            if (!empty($this->cache[$graph]['vertexCollections'])) {
                return $this->cache[$graph]['vertexCollections'];
            }
        }
        $url = UrlHelper::buildUrl(Urls::URL_GRAPH, [$graph, Urls::URLPART_VERTEX]);

        if ($excludeOrphans === true) {
            $url = UrlHelper::appendParamsUrl($url, ['excludeOrphans' => $excludeOrphans]);
        }

        $connection       = $this->getConnection();
        $batchCaptureMode = $connection->isInBatchCaptureMode();

        if ($batchCaptureMode === true) {
            $this->getConnection()->setBatchRequest(false);
        }

        try {
            $response = $this->getConnection()->get($url);
        } catch (Exception $e) {
            throw new ClientException($e->getMessage());
        }

        if ($batchCaptureMode === true) {
            $this->getConnection()->setBatchRequest(true);
        }

        $data = $response->getJson();
        $data = $data[self::OPTION_COLLECTIONS];

        sort($data);

        if ($_useCache === true) {
            if ($excludeOrphans === true && !empty($this->cache[$graph]['excludeOrphans']['vertexCollections'])) {
                $this->cache[$graph]['excludeOrphans']['vertexCollections'] = $data;
            } else {
                $this->cache[$graph]['vertexCollections'] = $data;
            }
        }

        return $data;
    }
public function getVertexCollections ( $ graph , array $ options = [ ] ) { if ( $ graph instanceof Graph ) { $ graph = $ graph -> getKey ( ) ; } $ excludeOrphans = false ; $ _useCache = $ this -> cacheEnabled ; if ( ( bool ) $ options && isset ( $ options [ 'excludeOrphans' ] ) && ! is_bool ( $ options [ 'excludeOrphans' ] ) ) { $ excludeOrphans = UrlHelper :: getBoolString ( $ options [ 'excludeOrphans' ] ) ; } if ( $ _useCache === true ) { if ( $ excludeOrphans === true && ! empty ( $ this -> cache [ $ graph ] [ 'excludeOrphans' ] [ 'result' ] ) ) { return $ this -> cache [ $ graph ] [ 'excludeOrphans' ] [ 'vertexCollections' ] ; } if ( ! empty ( $ this -> cache [ $ graph ] [ 'vertexCollections' ] ) ) { return $ this -> cache [ $ graph ] [ 'vertexCollections' ] ; } } $ url = UrlHelper :: buildUrl ( Urls :: URL_GRAPH , [ $ graph , Urls :: URLPART_VERTEX ] ) ; if ( $ excludeOrphans === true ) { $ url = UrlHelper :: appendParamsUrl ( $ url , [ 'excludeOrphans' => $ excludeOrphans ] ) ; } $ connection = $ this -> getConnection ( ) ; $ batchCaptureMode = $ connection -> isInBatchCaptureMode ( ) ; if ( $ batchCaptureMode === true ) { $ this -> getConnection ( ) -> setBatchRequest ( false ) ; } try { $ response = $ this -> getConnection ( ) -> get ( $ url ) ; } catch ( Exception $ e ) { throw new ClientException ( $ e -> getMessage ( ) ) ; } if ( $ batchCaptureMode === true ) { $ this -> getConnection ( ) -> setBatchRequest ( true ) ; } $ data = $ response -> getJson ( ) ; $ data = $ data [ self :: OPTION_COLLECTIONS ] ; sort ( $ data ) ; if ( $ _useCache === true ) { if ( $ excludeOrphans === true && ! empty ( $ this -> cache [ $ graph ] [ 'excludeOrphans' ] [ 'vertexCollections' ] ) ) { $ this -> cache [ $ graph ] [ 'excludeOrphans' ] [ 'vertexCollections' ] = $ data ; } else { $ this -> cache [ $ graph ] [ 'vertexCollections' ] = $ data ; } } return $ data ; }
gets all vertex collection from the graph.

This will get all vertex collection (orphans and used in edge definitions) from the graph.<br><br>

If this method or any method that calls this method is used in batch mode and caching is off,<br>
then for each call, this method will make an out of batch API call to the db in order to get the appropriate collections.<br><br>

If caching is on, then the GraphHandler will only call the DB API once for the chosen graph, and return data from cache for the following calls.<br>

@param mixed $graph                                                      - graph name as a string or instance of Graph
@param array $options                                                    - optional, an array of options
<p>Options are :<br>
<li>'excludeOrphans' - boolean value:    true to exclude the orphans or false to include orphans in the result.<br>
Defaults to false</li>

@return array
@throws ClientException@since 2.2
gets all vertex collection from the graph .