Menu

## Connection extends Authenticable
in package

Connection.php : 23

Represents a connection with an ArangoDB database.

##### Tags

author

  Lucas S. Vieira

### 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.php : 37

Connection constructor.

`public __construct(array<string|int, mixed> $options) : mixed`

##### Parameters

$options : array<string|int, mixed>

  Connection options.

##### Tags

throws
  InvalidParameterException|MissingParameterException|GuzzleException|AuthException|ConnectionException

#### __debugInfo()

Connection.php : 49

Proper debug dump for connection objects.

`public __debugInfo() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### customHttpRequest()

Connection.php : 226

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

throws
  GuzzleException

##### Return values

ResponseInterface

#### delete()

Connection.php : 209

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

throws
  GuzzleException

##### Return values

ResponseInterface

#### get()

Connection.php : 145

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

throws
  GuzzleException

##### Return values

ResponseInterface

#### getBaseUri()

Connection.php : 97

Return the base endpoint URI.

`public getBaseUri() : string`

##### Return values

string

#### getDatabase()

Connection.php : 109

Return the database object for this connection

`public getDatabase() : Database`

##### Tags

throws
  GuzzleException|DatabaseException|InvalidParameterException|MissingParameterException

##### Return values

Database

#### getDatabaseName()

Connection.php : 119

Return the name of database handled

`public getDatabaseName() : string`

##### Return values

string

#### getDefaultHeaders()

Connection.php : 76

Return the connection default headers.

`public getDefaultHeaders() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### getUsername()

Connection.php : 129

Returns the name of user on server

`public getUsername() : string`

##### Return values

string

#### isAuthenticated()

Connection.php : 66

If connection is authenticated.

`public isAuthenticated() : bool`

##### Return values

bool —

True if connection already authenticate, false otherwise.

#### patch()

Connection.php : 193

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

throws
  GuzzleException

##### Return values

ResponseInterface

#### post()

Connection.php : 161

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

throws
  GuzzleException

##### Return values

ResponseInterface

#### put()

Connection.php : 177

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

throws
  GuzzleException

##### Return values

ResponseInterface

#### setDefaultHeaders()

Connection.php : 86

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.

## Search results