+
+
+
+ $database
+
+
+
+
+
+
+
+ Database object of graph
+
+
+
+ protected
+ Database
+ $database
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $edgeDefinitions
+
+
+
+
+
+
+
+ An array of definitions for the relations of graph.
+
+
+
+ protected
+ ArrayList
+ $edgeDefinitions
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $id
+
+
+
+
+
+
+
+ The internal id of this graph.
+
+
+
+ protected
+ string
+ $id
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $isNew
+
+
+
+
+
+
+
+ If this graph is a new one or a representation of existing document.
+
+
+
+ protected
+ bool
+ $isNew
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $isSmart
+
+
+
+
+
+
+
+ Flag if the graph is a smart graph.
+
+
+
+ protected
+ bool
+ $isSmart
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $key
+
+
+
+
+
+
+
+ The name of graph.
+
+
+
+ protected
+ string
+ $key
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $minReplicationFactor
+
+
+
+
+
+
+
+ The minimal replication factor used for every new collection in the graph.<br>
+If one shard has less than minReplicationFactor copies,
+we cannot write to this shard, but to all others.
+
+
+
+ protected
+ int
+ $minReplicationFactor
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $name
+
+
+
+
+
+
+
+ Graph name.
+
+
+
+ protected
+ string
+ $name
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $numberOfShards
+
+
+
+
+
+
+
+ Number of shards created for every new collection in the graph.
+
+
+
+ protected
+ int
+ $numberOfShards
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $orphanCollections
+
+
+
+
+
+
+
+ An array of additional vertex collections.<br>
+Documents within these collections do not have edges within this graph.
+
+
+
+ protected
+ array<string|int, mixed>
+ $orphanCollections
+ = []
+
+
+
+
+
+
+
+
+
+
+
+
+ $replicationFactor
+
+
+
+
+
+
+
+ The replication factor used for every new collection in the graph.
+
+
+
+ protected
+ int
+ $replicationFactor
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $revision
+
+
+
+
+
+
+
+ The revision of graph.
+
+
+
+ protected
+ string
+ $revision
+
+
+ Can be used to make sure to not override concurrent modifications to this graph.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ __construct()
+
+
+
+
+
+ Graph constructor.
+
+
+ public
+ __construct(string $name[, array<string|int, mixed> $attributes = [] ][, Database|null $database = null ]) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $name
+ : string
+
+ -
+
+
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
Graph optional attributes.
+
+
+
+ -
+ $database
+ : Database|null
+ = null
+ -
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ InvalidParameterException|MissingParameterException|Exception
+
+
+
+
+
+
+
+
+
+
+
+ __toString()
+
+
+
+
+
+ Returns a string representation of graph object.
+
+
+ public
+ __toString() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ addEdge()
+
+
+
+
+
+ Creates a new edge in the collection.<br>
+Within the attributes the edge has to contain a _from and _to value referencing to valid vertices in the graph
+Furthermore, the edge has to be valid in the definition of the used.
+
+
+ public
+ addEdge(string $collection[, array<string|int, mixed> $attributes = [] ][, bool $waitForSync = true ][, bool $returnNew = false ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the edge collection the edge belongs to.
+
+
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
The object attributes to be stored. Must contain '_to' and '_from' keys.
+
+
+
+ -
+ $waitForSync
+ : bool
+ = true
+ -
+
Define if the request should wait until synced to disk. Default is true.
+
+
+
+ -
+ $returnNew
+ : bool
+ = false
+ -
+
Define if the response should contain the complete new version of the document. Default is false.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+ True if Edge object exists. False if no graph with this name could be found
+or this collection is not part of the graph or one of the vertices ('_to' or '_from') does not exist.
+
+
+
+
+
+
+
+ addEdgeDefinition()
+
+
+
+
+
+ Adds an edge definition to graph.
+
+
+ public
+ addEdgeDefinition(string $collection, array<string|int, mixed> $from, array<string|int, mixed> $to) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
+
+
+ -
+ $from
+ : array<string|int, mixed>
+
+ -
+
List of vertex collection names.
+
+
+
+ -
+ $to
+ : array<string|int, mixed>
+
+ -
+
List of vertex collection names.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException
+
+
+
+
+
+
+
+
+
+
+
+
+ addVertex()
+
+
+
+
+
+ Adds a vertex to graph.
+
+
+ public
+ addVertex(string $collection[, array<string|int, mixed> $attributes = [] ][, bool $waitForSync = true ][, bool $returnNew = true ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the vertex collection the vertex should be inserted into.
+
+
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
The object attributes to be stored.
+
+
+
+ -
+ $waitForSync
+ : bool
+ = true
+ -
+
Define if the request should wait until synced to disk. Default is true.
+
+
+
+ -
+ $returnNew
+ : bool
+ = true
+ -
+
Define if the response should contain the complete new version of the document. Default is true.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+ True if the vertex could be added. False if no graph with this name could be found
+or if a graph is found but the collection is not part of the graph.
+
+
+
+
+
+
+
+ addVertexCollection()
+
+
+
+
+
+ Adds a vertex collection to the set of orphan collections of the graph.
+
+
+ public
+ addVertexCollection(string $collection) : bool
+
+
+
+
+ If the collection does not exist, it will be created.
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the vertex collection.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+
+
+
+
+ delete()
+
+
+
+
+
+ Removes a graph from server, if possible.
+
+
+ public
+ delete([bool $dropCollections = false ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $dropCollections
+ : bool
+ = false
+ -
+
If set true, drop collections of this graph as well.
+Collections will only be dropped if they are not used in other graphs.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+ True if operation was successful, false otherwise.
+
+
+
+
+
+
+
+ dropEdge()
+
+
+
+
+
+ Drops an edge from graph.
+
+
+ public
+ dropEdge(string $collection, string $edge[, bool $waitForSync = true ][, bool $returnOld = false ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the edge collection the edge belongs to.
+
+
+
+ -
+ $edge
+ : string
+
+ -
+
The _key attribute of the edge.
+
+
+
+ -
+ $waitForSync
+ : bool
+ = true
+ -
+
Define if the request should wait until synced to disk. Default is true.
+
+
+
+ -
+ $returnOld
+ : bool
+ = false
+ -
+
Define if the response should contain the complete new version of the document. Default is false.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+ True if the edge could be removed. False if no graph with this name could be found
+or if a graph is found but the collection is not part of the graph.
+
+
+
+
+
+
+
+ dropEdgeDefinition()
+
+
+
+
+
+ Remove one edge definition from the graph<br>
+This will only remove the edge collection,
+the vertex collections remain untouched and can still be used in your queries.
+
+
+ public
+ dropEdgeDefinition(string $collection[, bool $dropCollection = false ][, bool $waitForSync = true ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
+
+
+ -
+ $dropCollection
+ : bool
+ = false
+ -
+
Drop the collection as well. Collection will only be dropped if it is not used in other graphs.
+
+
+
+ -
+ $waitForSync
+ : bool
+ = true
+ -
+
Define if the request should wait until synced to disk.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException
+
+
+
+
+
+
+
+
+
+
+
+
+ dropVertex()
+
+
+
+
+
+ Drops a vertex from graph.
+
+
+ public
+ dropVertex(string $collection, string $vertex[, bool $waitForSync = true ][, bool $returnOld = false ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the vertex collection the vertex belongs to.
+
+
+
+ -
+ $vertex
+ : string
+
+ -
+
The _key attribute of the vertex.
+
+
+
+ -
+ $waitForSync
+ : bool
+ = true
+ -
+
Define if the request should wait until synced to disk. Default is true.
+
+
+
+ -
+ $returnOld
+ : bool
+ = false
+ -
+
Define if the response should contain the complete new version of the document. Default is false.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+ True if the vertex could be removed. False if no graph with this name could be found
+or if a graph is found but the collection is not part of the graph.
+
+
+
+
+
+
+
+ dropVertexCollection()
+
+
+
+
+
+ Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph<br>
+It can only remove vertex collections that are no longer part of edge definitions,<br>
+if they are used in edge definitions you are required to modify those first.
+
+
+ public
+ dropVertexCollection(string $collection[, bool $dropCollection = false ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the vertex collection.
+
+
+
+ -
+ $dropCollection
+ : bool
+ = false
+ -
+
Drop the collection as well. Collection will only be dropped if it is not used in other graphs.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+
+
+
+
+ getEdge()
+
+
+
+
+
+ Returns an edge document.
+
+
+ public
+ getEdge(string $collection, string $edge) : Edge|false
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the edge collection the edge belongs to.
+
+
+
+ -
+ $edge
+ : string
+
+ -
+
The _key attribute of the edge.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception|MissingParameterException|InvalidParameterException
+
+
+
+
+
+
+
+
+ Return values
+ Edge|false
+ —
+ A Edge object if edge exists. False if no graph with this name could be found
+or this collection is not part of the graph or the edge does not exist.
+
+
+
+
+
+
+
+ getEdgeDefinitions()
+
+
+
+
+
+ Return all edge definitions of graph.
+
+
+ public
+ getEdgeDefinitions() : ArrayList
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getId()
+
+
+
+
+
+ Returns the graph ID.
+
+
+ public
+ getId() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getKey()
+
+
+
+
+
+ Returns the graph key.
+
+
+ public
+ getKey() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getMinReplicationFactor()
+
+
+
+
+
+ Returns the minimal replication factor used for every new collection in the graph.
+
+
+ public
+ getMinReplicationFactor() : int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getName()
+
+
+
+
+
+ Gets the graph name.
+
+
+ public
+ getName() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getNumberOfShards()
+
+
+
+
+
+ Returns the number of shards that is used for every collection within this graph.
+
+
+ public
+ getNumberOfShards() : int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getOrphanCollections()
+
+
+
+
+
+ Returns the orphan collections in the graph.
+
+
+ public
+ getOrphanCollections() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+ getReplicationFactor()
+
-
+
+
+
+ Returns the replication factor used when initially creating collections for this graph.
+
+
+ public
+ getReplicationFactor() : int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getRevision()
+
+
+
+
+
+ Gets the graph revision.
+
+
+ public
+ getRevision() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getVertex()
+
+
+
+
+
+ Gets a vertex from the given collection.
+
+
+ public
+ getVertex(string $collection, string $vertex) : Vertex|false
+
+
+
+
+
+ Parameters
+
+ -
+ $collection
+ : string
+
+ -
+
The name of the vertex collection the vertex belongs to.
+
+
+
+ -
+ $vertex
+ : string
+
+ -
+
The _key attribute of the vertex.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|InvalidParameterException|MissingParameterException
+
+
+
+
+
+
+
+
+ Return values
+ Vertex|false
+ —
+ A Vertex object if vertex exists. False if no graph with this name could be found
+or this collection is not part of the graph or the vertex does not exist.
+
+
+
+
+
+
+
+ getVertexCollections()
+
+
+
+
+
+ Lists all vertex collections within this graph.
+
+
+ public
+ getVertexCollections() : ArrayList
+
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+
+
+
+
+ isNew()
+
+
+
+
+
+ Returns true if is a new graph.
+
+
+ public
+ isNew() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isSmart()
+
+
+
+
+
+ If this graph is a smartGraph.
+
+
+ public
+ isSmart() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jsonSerialize()
+
+
+
+
+
+ Return a JSON representation of graph attributes.
+
+
+ public
+ jsonSerialize() : array<string|int, mixed>|mixed
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>|mixed
+
+
+
+
+
+ save()
+
+
+
+
+
+ Save the Graph on server, if possible.
+
+
+ public
+ save() : bool
+
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ DatabaseException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+ True if operation was successful, false otherwise.
+
+
+
+
+
+
+
+ toArray()
+
+
+
+
+
+ Returns a array representation of graph.
+
+
+ public
+ toArray() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ traversal()
+
+
+
+
+
+ Returns a graph traversal.
+
+
+ public
+ traversal(Vertex $vertex[, string $direction = Traversal::GRAPH_DIRECTION_ANY ][, int $depth = 0 ]) : Traversal
+
+
+
+
+
+ Parameters
+
+ -
+ $vertex
+ : Vertex
+
+ -
+
+
+
+ -
+ $direction
+ : string
+ = Traversal::GRAPH_DIRECTION_ANY
+ -
+
Direction for traversal. Must be either "outbound", "inbound", or "any".
+
+
+
+ -
+ $depth
+ : int
+ = 0
+ -
+
Visits only nodes in at least the given depth.
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ CursorException|GuzzleException|Exception
+
+
+
+
+
+
+
+
+
+
+
+
+ getCreateParameters()
+
+
+
+
+
+ Return an array with parameters to create the graph.
+
+
+ private
+ getCreateParameters() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
-