\triagens\ArangoDbHandler

A base class for REST-based handlers


Summary

Methods
Properties
Constants
__construct()
No public properties found
No constants found
getConnection()
getConnectionOption()
getCursorOptions()
json_encode_wrapper()
validateAndIncludeOldSingleParameterInParams()
includeOptionsInParams()
includeOptionsInBody()
No protected properties found
N/A
No private methods found
$_connection
N/A

Properties

$_connection

$_connection : 

Connection object

Type

Methods

getConnection()

getConnection() : \triagens\ArangoDb\Connection

Return the connection object

Returns

\triagens\ArangoDb\Connection
  • the connection object

getConnectionOption()

getConnectionOption( $optionName) : mixed

Return a connection option This is a convenience function that calls json_encode_wrapper on the connection

Parameters

$optionName
  • The option to return a value for

Returns

mixed —
  • the option's value

getCursorOptions()

getCursorOptions(mixed $options) : array

Return an array of cursor options

Parameters

mixed $options
  • $options might be a boolean sanitize value, or an array of options, with or without a '_sanitize' key.

Returns

array —
  • array of options

json_encode_wrapper()

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

Parameters

array $body
  • The body to encode into json

Returns

string —
  • json string of the body that was passed

validateAndIncludeOldSingleParameterInParams()

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.

Parameters

array $options
  • The options array that may hold the policy to include in the parameters. If it's not an array, then the value is the policy value.
array $params
  • The parameters into which the options will be included.
mixed $parameter
  • the old single parameter key to use.

Returns

array —

$params - array of parameters for use in a url

includeOptionsInParams()

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...) .

Parameters

array $options
  • The options array that holds the options to include in the parameters
array $params
  • The parameters into which the options will be included.
array $includeArray
  • The array that defines which options are allowed to be included, and what their default value is. for example: 'waitForSync'=>true

Returns

array —

$params - array of parameters for use in a url

includeOptionsInBody()

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...) .

Parameters

array $options
  • The options array that holds the options to include in the parameters
array $body
  • The array into which the options will be included.
array $includeArray
  • The array that defines which options are allowed to be included, and what their default value is. for example: 'waitForSync'=>true

Returns

array —

$params - array of parameters for use in a url