PHP Class LMongo\ConnectionResolver

Inheritance: implements lmongo\ConnectionResolverInterface
Datei anzeigen Open project: navruzm/lmongo

Protected Properties

Property Type Description
$connections array All of the registered connections.
$default string The default connection name.

Public Methods

Method Description
__construct ( array $connections = [] ) : void Create a new connection resolver instance.
addConnection ( string $name, Connection $connection ) : void Add a connection to the resolver.
connection ( string $name = null ) : Illuminate\Database\Connection Get a database connection instance.
getDefaultConnection ( ) : string Get the default connection name.
hasConnection ( string $name ) : boolean Check if a connection has been registered.
setDefaultConnection ( string $name ) : void Set the default connection name.

Method Details

__construct() public method

Create a new connection resolver instance.
public __construct ( array $connections = [] ) : void
$connections array
return void

addConnection() public method

Add a connection to the resolver.
public addConnection ( string $name, Connection $connection ) : void
$name string
$connection Connection
return void

connection() public method

Get a database connection instance.
public connection ( string $name = null ) : Illuminate\Database\Connection
$name string
return Illuminate\Database\Connection

getDefaultConnection() public method

Get the default connection name.
public getDefaultConnection ( ) : string
return string

hasConnection() public method

Check if a connection has been registered.
public hasConnection ( string $name ) : boolean
$name string
return boolean

setDefaultConnection() public method

Set the default connection name.
public setDefaultConnection ( string $name ) : void
$name string
return void

Property Details

$connections protected_oe property

All of the registered connections.
protected array $connections
return array

$default protected_oe property

The default connection name.
protected string $default
return string