A handler that manages views.

package ArangoDBClient
since 3.4
inherited_from \ArangoDBClient\Handler

 Methods

Construct a new handler

__construct(\ArangoDBClient\Connection $connection) 
Inherited

Parameters

$connection

\ArangoDBClient\Connection
  • connection to be used

Create a view

create(\ArangoDBClient\View $view) : array

This will create a view using the given view object and return an array of the created view object's attributes.

since 3.4

Parameters

$view

\ArangoDBClient\View
  • The view object which holds the information of the view to be created

Exceptions

\ArangoDBClient\Exception

Returns

array

Drop a view<br><br>

drop(mixed $view) : boolean
since 3.4

Parameters

$view

mixed
  • view name as a string or instance of View

Exceptions

\ArangoDBClient\Exception

Returns

boolean- always true, will throw if there is an error

Get a view

get(String $view) : \ArangoDBClient\View | false

This will get a view.

since 3.4

Parameters

$view

String
  • The name of the view

Exceptions

\ArangoDBClient\ClientException

Returns

\ArangoDBClient\Viewfalse

Get a view's properties<br><br>

properties(mixed $view) : array
since 3.4

Parameters

$view

mixed
  • view name as a string or instance of View

Exceptions

\ArangoDBClient\Exception

Returns

array- Returns an array of attributes. Will throw if there is an error

Rename a view

rename(mixed $view, string $name) : boolean

Parameters

$view

mixed
  • view name as a string or instance of View

$name

string
  • new name for collection

Exceptions

\ArangoDBClient\Exception

Returns

boolean- always true, will throw if there is an error

Sets the document class to use

setDocumentClass(string $class) : \ArangoDBClient\DocumentClassable
Inherited

Parameters

$class

string

Document class to use

Returns

\ArangoDBClient\DocumentClassable

Sets the edge class to use

setEdgeClass(string $class) : \ArangoDBClient\DocumentClassable
Inherited

Parameters

$class

string

Edge class to use

Returns

\ArangoDBClient\DocumentClassable

Set a view's properties<br><br>

setProperties(mixed $view, array $properties) : array
since 3.4

Parameters

$view

mixed
  • view name as a string or instance of View

$properties

array
  • array with view properties

Exceptions

\ArangoDBClient\Exception

Returns

array- Returns an array of attributes. Will throw if there is an error

Add a transaction header to the array of headers in case this is a transactional operation

addTransactionHeader(array $headers, mixed $collection) 
Inherited

Parameters

$headers

array
  • already existing headers

$collection

mixed
  • any type of collection (can be StreamingTransactionCollection or other)

Return the connection object

getConnection() : \ArangoDBClient\Connection
Inherited

Returns

\ArangoDBClient\Connection- the connection object

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

getConnectionOption($optionName) : mixed
Inherited

Parameters

$optionName

  • The option to return a value for

Exceptions

\ArangoDBClient\ClientException

Returns

mixed- the option's value

Helper function that runs through the options given and includes them into the parameters array given.

includeOptionsInBody(array $options, array $body, array $includeArray = array()) : array
Inherited

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

$options

array
  • The options array that holds the options to include in the parameters

$body

array
  • The array into which the options will be included.

$includeArray

array
  • 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

Return a json encoded string for the array passed.

json_encode_wrapper(array $body) : string
Inherited

This is a convenience function that calls json_encode_wrapper on the connection

Parameters

$body

array
  • The body to encode into json

Exceptions

\ArangoDBClient\ClientException

Returns

string- json string of the body that was passed

Turn a value into a collection name

makeCollection(mixed $value) : string
Inherited

Parameters

$value

mixed
  • document, collection or string

Exceptions

\ArangoDBClient\ClientException

Returns

string- collection name

 Properties

 

Document class to use

$_documentClass : string

Default

'\ArangoDBClient\Document'
 

Edge class to use

$_edgeClass : string

Default

'\ArangoDBClient\Edge'
 

Connection object

$_connection 

Default

param

 Constants

 

rename option

OPTION_RENAME = 'rename'