Connection
extends Authenticable
in package
Represents a connection with an ArangoDB database.
Tags
Table of Contents
Methods
- __construct() : mixed
- Connection constructor.
- __debugInfo() : array<string|int, mixed>
- Proper debug dump for connection objects.
- customHttpRequest() : ResponseInterface
- Makes a custom HTTP request.
- delete() : ResponseInterface
- Executes a DELETE request on server.
- get() : ResponseInterface
- Executes a GET request on server.
- getBaseUri() : string
- Return the base endpoint URI.
- getDatabase() : Database
- Return the database object for this connection
- getDatabaseName() : string
- Return the name of database handled
- getDefaultHeaders() : array<string|int, mixed>
- Return the connection default headers.
- getUsername() : string
- Returns the name of user on server
- isAuthenticated() : bool
- If connection is authenticated.
- patch() : ResponseInterface
- Executes a PATCH request on server.
- post() : ResponseInterface
- Executes a POST request on server.
- put() : ResponseInterface
- Executes a PUT request on server.
- setDefaultHeaders() : mixed
- Set the connection default headers.
Methods
__construct()
Connection constructor.
public
__construct(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
-
Connection options.
Tags
__debugInfo()
Proper debug dump for connection objects.
public
__debugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>customHttpRequest()
Makes a custom HTTP request.
public
customHttpRequest(string $method, string $uri[, string $body = "" ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $method : string
-
HTTP Method to use.
- $uri : string
-
URI to make the request.
- $body : string = ""
-
The body content.
- $headers : array<string|int, mixed> = []
-
Additional headers to send on request.
Tags
Return values
ResponseInterfacedelete()
Executes a DELETE request on server.
public
delete(string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $endpoint : string
-
URI to make the request.
- $body : array<string|int, mixed> = []
-
The body content.
- $headers : array<string|int, mixed> = []
-
Additional headers to send on request.
Tags
Return values
ResponseInterfaceget()
Executes a GET request on server.
public
get(string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $endpoint : string
-
URI to make the request.
- $body : array<string|int, mixed> = []
-
The body content.
- $headers : array<string|int, mixed> = []
-
Additional headers to send on request.
Tags
Return values
ResponseInterfacegetBaseUri()
Return the base endpoint URI.
public
getBaseUri() : string
Return values
stringgetDatabase()
Return the database object for this connection
public
getDatabase() : Database
Tags
Return values
DatabasegetDatabaseName()
Return the name of database handled
public
getDatabaseName() : string
Return values
stringgetDefaultHeaders()
Return the connection default headers.
public
getDefaultHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getUsername()
Returns the name of user on server
public
getUsername() : string
Return values
stringisAuthenticated()
If connection is authenticated.
public
isAuthenticated() : bool
Return values
bool —True if connection already authenticate, false otherwise.
patch()
Executes a PATCH request on server.
public
patch(string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $endpoint : string
-
URI to make the request.
- $body : array<string|int, mixed> = []
-
The body content.
- $headers : array<string|int, mixed> = []
-
Additional headers to send on request.
Tags
Return values
ResponseInterfacepost()
Executes a POST request on server.
public
post(string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $endpoint : string
-
URI to make the request.
- $body : array<string|int, mixed> = []
-
The body content.
- $headers : array<string|int, mixed> = []
-
Additional headers to send on request.
Tags
Return values
ResponseInterfaceput()
Executes a PUT request on server.
public
put(string $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Parameters
- $endpoint : string
-
URI to make the request.
- $body : array<string|int, mixed> = []
-
The body content.
- $headers : array<string|int, mixed> = []
-
Additional headers to send on request.
Tags
Return values
ResponseInterfacesetDefaultHeaders()
Set the connection default headers.
public
setDefaultHeaders(array<string|int, mixed> $headers) : mixed
Parameters
- $headers : array<string|int, mixed>
-
The default array to add on all requests.