Arango PHP ODM

Database extends DatabaseHandler
in package

Represents an ArangoDB database

Tags
author

Lucas S. Vieira

Table of Contents

Methods

__construct()  : mixed
Database constructor.
create()  : bool
Creates a new database on server
createCollection()  : Collection
Create a new collection on database
current()  : array<string|int, mixed>
Returns information about the current database
drop()  : bool
Drops a database from server
dropCollection()  : bool
Drops a given collection of database
getAllCollections()  : ArrayList
Return all collections of database
getAllGraphs()  : ArrayList
Lists all graphs stored in this database.
getCollection()  : Collection|bool
Return the collection object for a given collection
getConnection()  : Connection
Return the connection object
getDatabaseName()  : string
Return the name of database handled
getGraph()  : Graph|false
Check if database has a given graph
getInfo()  : array<string|int, mixed>
Returns information about the current database
hasCollection()  : bool
Check if database has given collection
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()

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.

createCollection()

Create a new collection on database

public createCollection(string $collection[, array<string|int, mixed> $attributes = [] ]) : Collection
Parameters
$collection : string

Collection name

$attributes : array<string|int, mixed> = []

If you want to specify some custom attribute to collection

Tags
throws
DatabaseException|GuzzleException|InvalidParameterException|MissingParameterException
see
https://www.arangodb.com/docs/stable/http/collection-creating.html#create-collection
Return values
Collection

A Collection object if operation was successful, throws an exception otherwise

drop()

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.

getDatabaseName()

Return the name of database handled

public getDatabaseName() : string
Return values
string

getInfo()

Returns information about the current database

public getInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasCollection()

Check if database has given collection

public hasCollection(string $collection) : bool
Parameters
$collection : string

Collection name

Tags
throws
GuzzleException|DatabaseException
Return values
bool

True if operation was successful, false otherwise


        
On this page

Search results