ENTRY_DOCUMENTS
ENTRY_DOCUMENTS
documents array index
A handler that manages vertices.
A vertex-document handler that fetches vertices from the server and persists them on the server. It does so by issuing the appropriate HTTP requests to the server.
get(string $collectionId, mixed $documentId, array $options) : \triagens\ArangoDb\Document
Get a single document from a collection
Alias method for getById()
string | $collectionId |
|
mixed | $documentId |
|
array | $options |
|
getById(string $collectionId, mixed $documentId, array $options) : \triagens\ArangoDb\Document
Get a single document from a collection
This will throw if the document cannot be fetched from the server.
string | $collectionId |
|
mixed | $documentId |
|
array | $options |
|
getHead(string $collectionId, mixed $documentId, $revision, $ifMatch) : array
Gets information about a single documents from a collection
This will throw if the document cannot be fetched from the server
string | $collectionId |
|
mixed | $documentId |
|
$revision | ||
$ifMatch |
createFromArrayWithContext( $data, $options) : \triagens\ArangoDb\Document
Intermediate function to call the createFromArray function from the right context
$data | ||
$options |
getAllIds(mixed $collectionId) : array
Get the list of all documents' ids from a collection
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
getByExample(mixed $collectionId, mixed $document, boolean|array $options) : \triagens\ArangoDb\cursor
Get document(s) by specifying an example
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
mixed | $document |
|
boolean|array | $options |
|
None found |
add(mixed $collectionId, \triagens\ArangoDb\Document $document, boolean|array $options) : mixed
Add a document to a collection
This will add the document to the collection and return the document's id
This will throw if the document cannot be created
mixed | $collectionId |
|
\triagens\ArangoDb\Document | $document |
|
boolean|array | $options |
|
None found |
store(\triagens\ArangoDb\Document $document, mixed $collectionId, boolean|array $options) : mixed
Store a document to a collection
This is an alias/shortcut to save() and replace(). Instead of having to determine which of the 3 functions to use, simply pass the document to store() and it will figure out which one to call.
This will throw if the document cannot be saved or replaced.
\triagens\ArangoDb\Document | $document |
|
mixed | $collectionId |
|
boolean|array | $options |
|
since | 1.0 |
---|
save(mixed $collectionId, mixed $document, boolean|array $options) : mixed
save a document to a collection
This will add the document to the collection and return the document's id
This will throw if the document cannot be saved
mixed | $collectionId |
|
mixed | $document |
|
boolean|array | $options |
|
since | 1.0 |
---|
update(\triagens\ArangoDb\Document $document, mixed $options) : boolean
Update an existing document in a collection, identified by the including _id and optionally _rev in the patch document.
Attention - The behavior of this method has changed since version 1.1
This will update the document on the server
This will throw if the document cannot be updated
If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the document to-be-replaced is the same as the one given.
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
updateById(string $collectionId, mixed $documentId, \triagens\ArangoDb\Document $document, mixed $options) : boolean
Update an existing document in a collection, identified by collection id and document id Attention - The behavior of this method has changed since version 1.1
This will update the document on the server
This will throw if the document cannot be updated
If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the document to-be-updated is the same as the one given.
string | $collectionId |
|
mixed | $documentId |
|
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
replace(\triagens\ArangoDb\Document $document, mixed $options) : boolean
Replace an existing document in a collection, identified by the document itself
This will update the document on the server
This will throw if the document cannot be updated
If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the to-be-replaced document is the same as the one given.
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
replaceById(mixed $collectionId, mixed $documentId, \triagens\ArangoDb\Document $document, mixed $options) : boolean
Replace an existing document in a collection, identified by collection id and document id
This will update the document on the server
This will throw if the document cannot be Replaced
If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the to-be-replaced document is the same as the one given.
mixed | $collectionId |
|
mixed | $documentId |
|
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
delete(\triagens\ArangoDb\Document $document, mixed $options) : boolean
Delete a document from a collection, identified by the document itself
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
remove(\triagens\ArangoDb\Document $document, mixed $options) : boolean
Remove a document from a collection, identified by the document itself
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
deleteById(string $collectionId, mixed $documentId, mixed $revision, mixed $options) : boolean
Delete a document from a collection, identified by the collection id and document id
string | $collectionId |
|
mixed | $documentId |
|
mixed | $revision |
|
mixed | $options |
|
None found |
removeById(mixed $collectionId, mixed $documentId, mixed $revision, mixed $options) : boolean
Remove a document from a collection, identified by the collection id and document id
mixed | $collectionId |
|
mixed | $documentId |
|
mixed | $revision |
|
mixed | $options |
|
None found |
__construct(\triagens\ArangoDb\Connection $connection) : \triagens\ArangoDb\Handler
Construct a new handler
\triagens\ArangoDb\Connection | $connection |
|
None found |
getDocument(string $url, string $collectionId, mixed $documentId, array $options) : \triagens\ArangoDb\Document
Get a single document (internal method)
This method is the workhorse for getById() in this handler and the edges handler
string | $url |
|
string | $collectionId |
|
mixed | $documentId |
|
array | $options |
|
None found |
head(string $url, string $collectionId, mixed $documentId, mixed $revision, $ifMatch) : array
Get meta-data for a single document (internal method)
This method is the workhorse for getHead() in this handler and the edges handler
string | $url |
|
string | $collectionId |
|
mixed | $documentId |
|
mixed | $revision |
|
$ifMatch |
None found |
patch(string $url, string $collectionId, mixed $documentId, \triagens\ArangoDb\Document $document, mixed $options) : boolean
Update an existing document in a collection (internal method)
string | $url |
|
string | $collectionId |
|
mixed | $documentId |
|
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
put(string $url, string $collectionId, mixed $documentId, \triagens\ArangoDb\Document $document, mixed $options) : boolean
Replace an existing document in a collection (internal method)
string | $url |
|
string | $collectionId |
|
mixed | $documentId |
|
\triagens\ArangoDb\Document | $document |
|
mixed | $options |
|
None found |
erase(string $url, string $collectionId, mixed $documentId, mixed $revision, mixed $options) : boolean
Remove a document from a collection (internal method)
string | $url |
|
string | $collectionId |
|
mixed | $documentId |
|
mixed | $revision |
|
mixed | $options |
|
None found |
getConnection() : \triagens\ArangoDb\Connection
Return the connection object
None found |
getConnectionOption( $optionName) : mixed
Return a connection option This is a convenience function that calls json_encode_wrapper on the connection
$optionName |
|
None found |
getCursorOptions(mixed $options) : array
Return an array of cursor options
mixed | $options |
|
None found |
json_encode_wrapper(array $body) : string
Return a json encoded string for the array passed.
This is a convenience function that calls json_encode_wrapper on the connection
array | $body |
|
None found |
validateAndIncludeOldSingleParameterInParams(array $options, array $params, mixed $parameter) : array
Helper function that validates and includes an old single method parameter setting into the parameters array given.
This is only for keeping backwards-compatibility where methods had for example a parameter which was called 'policy' and which was later changed to being an array of options, so more than one options can be passed easily. This is only for options that are to be sent to the ArangoDB server.
array | $options |
|
array | $params |
|
mixed | $parameter |
|
$params - array of parameters for use in a url
None found |
includeOptionsInParams(array $options, array $params, array $includeArray) : array
Helper function that runs through the options given and includes them into the parameters array given.
Only options that are set in $includeArray will be included. This is only for options that are to be sent to the ArangoDB server in form of url parameters (like 'waitForSync', 'keepNull', etc...) .
array | $options |
|
array | $params |
|
array | $includeArray |
|
$params - array of parameters for use in a url
None found |
includeOptionsInBody(array $options, array $body, array $includeArray) : array
Helper function that runs through the options given and includes them into the parameters array given.
Only options that are set in $includeArray will be included. This is only for options that are to be sent to the ArangoDB server in a json body(like 'limit', 'skip', etc...) .
array | $options |
|
array | $body |
|
array | $includeArray |
|
$params - array of parameters for use in a url
None found |
getDocumentId(mixed $document) : mixed
Helper function to get a document id from a document or a document id value
mixed | $document |
|
None found |
getRevision(mixed $document) : mixed
Helper function to get a document id from a document or a document id value
mixed | $document |
|
None found |
getCollectionId(\triagens\ArangoDb\Document $document) : mixed
Helper function to get a collection id from a document
\triagens\ArangoDb\Document | $document |
|
None found |