Documentation

ConnectionResolver
in package
implements ConnectionResolverInterface

Interfaces, Classes and Traits

ConnectionResolverInterface

Table of Contents

$connections  : array<string|int, mixed>
All of the registered connections.
$default  : string
The default connection name.
__construct()  : void
Create a new connection resolver instance.
addConnection()  : void
Add a connection to the resolver.
connection()  : ConnectionInterface
Get a database connection instance.
getDefaultConnection()  : string
Get the default connection name.
hasConnection()  : bool
Check if a connection has been registered.
setDefaultConnection()  : void
Set the default connection name.

Properties

$connections

All of the registered connections.

protected array<string|int, mixed> $connections = []

Methods

__construct()

Create a new connection resolver instance.

public __construct([array<string|int, mixed> $connections = [] ]) : void
Parameters
$connections : array<string|int, mixed> = []
Return values
void

getDefaultConnection()

Get the default connection name.

public getDefaultConnection() : string
Return values
string

hasConnection()

Check if a connection has been registered.

public hasConnection(string $name) : bool
Parameters
$name : string
Return values
bool

setDefaultConnection()

Set the default connection name.

public setDefaultConnection(string $name) : void
Parameters
$name : string
Return values
void

Search results