Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

calling hasVertex on a graph with more then one vertex is failing #279

Open
@FLasH3r

Description

@FLasH3r

My Environment

Latest version (3.6.0), PHP 7.3

Component, Query & Data

Affected feature:
Unable to useHasHandler on a graph with more then one vertex.
error:ArangoDBClient\\ClientException: A collection must be provided.

Steps to reproduce

  1. create a graph with more than one vertex
  2. callhasVertex on any vertex, get the error

Problem:
when callingGraphHandler methodHasHandler, the signature is as described in the code:

     /**     * Check if a vertex exists     *     * This will call self::getVertex() internally and checks if there     * was an exception thrown which represents an 404 request.     *     * @throws Exception When any other error than a 404 occurs     *     * @param mixed $graph    - graph name as a string or instance of Graph     * @param mixed $vertexId - the vertex identifier     *     * @return boolean     */    public function hasVertex($graph, $vertexId)    {        try {            // will throw ServerException if entry could not be retrieved            $this->getVertex($graph, $vertexId);            return true;        } catch (ServerException $e) {            // we are expecting a 404 to return boolean false            if ($e->getCode() === 404) {                return false;            }            // just rethrow            throw $e;        }    }

My graph has more then one vertex as described in the doc block ofgetVertex, so I need to pass the$collection parameter, but it does not exists in thehasVertex method

     /**     * Get a single vertex from a graph     *     * This will throw if the vertex cannot be fetched from the server<br><br>     *     * @throws Exception     *     * @param mixed  $graph      - graph name as a string or instance of Graph     * @param mixed  $vertexId   - the vertex identifier     * @param array  $options    optional, an array of options:     *                           <p>     *                           <li><b>_includeInternals</b> - true to include the internal attributes. Defaults to false</li>     *                           <li><b>_ignoreHiddenAttributes</b> - true to show hidden attributes. Defaults to false</li>     *                           </p>     * @param string $collection - if one uses a graph with more than one vertex collection one must provide the collection     *                           to load the vertex.     *     * @return Document     * @since 1.2     */    public function getVertex($graph, $vertexId, array $options = [], $collection = null)

Expected result:
hasVertex should work on a graph setup with more then one vertex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp