Menu

## DatabaseHandler extends ManagesConnection
in package

Abstract Yes
DatabaseHandler.php : 20

Manages databases on Arango server

##### Tags

author

  Lucas S. Vieira

### Table of Contents

#### Methods

create() : bool
  Creates a new database on server
current() : array<string|int, mixed>
  Returns information about the current database
drop() : bool
  Drops a database from server
getConnection() : Connection
  Return the connection object
list() : ArrayList
  Lists databases that exists on server
setConnection() : void
  Sets a connection for class.
userDatabases() : ArrayList
  Lists the databases that current user has access

### Methods

#### create()

DatabaseHandler.php : 32

Creates a new database on server

`public static create(Connection $connection, string $database) : bool`

##### Parameters

$connection : Connection

  Connection object to be used

$database : string

  Database name

##### Tags

throws
  GuzzleException|DatabaseException

##### Return values

bool —

True if database was successfully created on server. Throw an exception otherwise.

#### current()

DatabaseHandler.php : 139

Returns information about the current database

`public static current(Connection $connection) : array<string|int, mixed>`

##### Parameters

$connection : Connection

  Connection object to be used

##### Tags

throws
  GuzzleException|DatabaseException
see
  https://www.arangodb.com/docs/stable/http/database-database-management.html#information-of-the-database

##### Return values

array<string|int, mixed> —

An array with information about database.

#### drop()

DatabaseHandler.php : 60

Drops a database from server

`public static drop(Connection $connection, string $database) : bool`

##### Parameters

$connection : Connection

  Connection object to be used

$database : string

  Database name

##### Tags

throws
  DatabaseException|GuzzleException

##### Return values

bool —

True if database was successfully dropped on server. Throw an exception otherwise.

#### getConnection()

ManagesConnection.php : 36

Return the connection object

`public getConnection() : Connection`

##### Return values

Connection

#### list()

DatabaseHandler.php : 90

Lists databases that exists on server

`public static list(Connection $connection) : ArrayList`

##### Parameters

$connection : Connection

  Connection object to be used

##### Tags

throws
  GuzzleException|DatabaseException

##### Return values

ArrayList —

A list with all databases on server.

#### setConnection()

ManagesConnection.php : 26

Sets a connection for class.

`public setConnection(Connection $connection) : void`

##### Parameters

$connection : Connection

  Connection object to use.

#### userDatabases()

DatabaseHandler.php : 114

Lists the databases that current user has access

`public static userDatabases(Connection $connection) : ArrayList`

##### Parameters

$connection : Connection

  Connection object to be used

##### Tags

throws
  GuzzleException|DatabaseException

##### Return values

ArrayList —

A list with all databases on server that current user has access.

## Search results