ArangoDB-PHP API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • triagens
    • ArangoDb

Classes

  • AdminHandler
  • AqlUserFunction
  • Autoloader
  • Batch
  • BatchPart
  • BindVars
  • Collection
  • CollectionHandler
  • Connection
  • ConnectionOptions
  • Cursor
  • Database
  • DefaultValues
  • Document
  • DocumentHandler
  • Edge
  • EdgeDefinition
  • EdgeHandler
  • Endpoint
  • Export
  • ExportCursor
  • Graph
  • GraphHandler
  • Handler
  • HttpHelper
  • HttpResponse
  • QueryCacheHandler
  • QueryHandler
  • Statement
  • TraceRequest
  • TraceResponse
  • Transaction
  • Traversal
  • UpdatePolicy
  • UrlHelper
  • Urls
  • User
  • UserHandler
  • ValueValidator
  • Vertex
  • VertexHandler

Exceptions

  • ClientException
  • ConnectException
  • Exception
  • ServerException

Class AqlUserFunction

Provides management of user-functions

AqlUserFunction object
An AqlUserFunction is an object that is used to manage AQL User Functions.
It registers, un-registers and lists user functions on the server

The object encapsulates:

  • the name of the function
  • the actual javascript function


The object requires the connection object and can be initialized with or without initial configuration.

Any configuration can be set and retrieved by the object's methods like this:

$this->setName('myFunctions:myFunction');<br>
$this->setCode('function (){your code};');


or like this:

$this->name('myFunctions:myFunction');<br>
$this->code('function (){your code};');
Namespace: triagens\ArangoDb
Package: triagens\ArangoDb
Since: 1.3
Located at AqlUserFunction.php

Methods summary

public
# __construct( triagens\ArangoDb\Connection $connection, array $attributesArray = null )

Initialise the AqlUserFunction object

Initialise the AqlUserFunction object

The $attributesArray array can be used to specify the name and code for the user function in form of an array.

Example: array( 'name' => 'myFunctions:myFunction', 'code' => 'function (){}' )

Parameters

$connection
  • the connection to be used
$attributesArray
  • user function initialization data

Throws

triagens\ArangoDb\ClientException
public mixed
# register( null $name = null, null $code = null )

Registers the user function

Registers the user function

If no parameters ($name,$code) are passed, it will use the properties of the object.

If $name and/or $code are passed, it will override the object's properties with the passed ones

Parameters

$name
$code

Returns

mixed
true if registration was successful.

Throws

triagens\ArangoDb\Exception
throws exception if registration failed
public mixed
# unregister( string $name = null, boolean $namespace = false )

Un-register the user function

Un-register the user function

If no parameter ($name) is passed, it will use the property of the object.

If $name is passed, it will override the object's property with the passed one

Parameters

$name
$namespace

Returns

mixed
true if successful without a return value or the return value if one was set in the action

Throws

triagens\ArangoDb\Exception
throw exception if the request fails
public mixed
# getRegisteredUserFunctions( null $namespace = null )

Get registered user functions

Get registered user functions

The method can optionally be passed a $namespace parameter to narrow the results down to a specific namespace.

Parameters

$namespace

Returns

mixed
true if successful without a return value or the return value if one was set in the action

Throws

triagens\ArangoDb\Exception
throw exception if the request failed
protected triagens\ArangoDb\Connection
# getConnection( )

Return the connection object

Return the connection object

Returns

triagens\ArangoDb\Connection
  • the connection object
public
# setName( string $value )

Set name of the user function. It must have at least one namespace, but also can have sub-namespaces. correct: 'myNamespace:myFunction' 'myRootNamespace:mySubNamespace:myFunction'

Set name of the user function. It must have at least one namespace, but also can have sub-namespaces. correct: 'myNamespace:myFunction' 'myRootNamespace:mySubNamespace:myFunction'

wrong: 'myFunction'

Parameters

$value

Throws

triagens\ArangoDb\ClientException
public string
# getName( )

Get name value

Get name value

Returns

string
name
public
# setCode( string $value )

Set user function code

Set user function code

Parameters

$value

Throws

triagens\ArangoDb\ClientException
public string
# getCode( )

Get user function code

Get user function code

Returns

string
name
public
# set( $key, $value )

Set an attribute

Set an attribute

Parameters

$key
$value

Returns


$this

Throws

triagens\ArangoDb\ClientException
public
# __set( string $key, mixed $value )

Set an attribute, magic method

Set an attribute, magic method

This is a magic method that allows the object to be used without declaring all attributes first.

Parameters

$key
  • attribute name
$value
  • value for attribute

Throws

triagens\ArangoDb\ClientException

Magic

public mixed
# get( string $key )

Get an attribute

Get an attribute

Parameters

$key
  • name of attribute

Returns

mixed
  • value of attribute, NULL if attribute is not set
public boolean
# __isset( string $key )

Is triggered by calling isset() or empty() on inaccessible properties.

Is triggered by calling isset() or empty() on inaccessible properties.

Parameters

$key
  • name of attribute

Returns

boolean
returns true or false (set or not set)
public mixed
# __get( string $key )

Get an attribute, magic method

Get an attribute, magic method

This function is mapped to get() internally.

Parameters

$key
  • name of attribute

Returns

mixed
  • value of attribute, NULL if attribute is not set

Magic

public string
# __toString( )

Returns the action string

Returns the action string

Returns

string
  • the current action string

Magic

public
# buildAttributesFromArray( $options )

Build the object's attributes from a given array

Build the object's attributes from a given array

Parameters

$options

Throws

triagens\ArangoDb\ClientException

Constants summary

string ENTRY_NAME

Collections index

Collections index

# 'name'
string ENTRY_CODE

Action index

Action index

# 'code'

Properties summary

protected array $attributes

The transaction's attributes.

The transaction's attributes.

# []
protected string $_action

The transaction's action.

The transaction's action.

# ''

Magic properties

public string $name
  • The name of the user function
public string $code
  • The code of the user function
ArangoDB-PHP API Documentation API documentation generated by ApiGen