- Notifications
You must be signed in to change notification settings - Fork49
Open
Description
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
- create a graph with more than one vertex
- call
hasVertex
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
Labels
No labels