PHP Class LMongo\DatabaseManager

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

Protected Properties

Property Type Description
$app Illuminate\Foundation\Application The application instance.
$connections array The active connection instances.
$extensions array The custom connection resolvers.

Public Methods

Method Description
__call ( string $method, array $parameters ) : mixed Dynamically pass methods to the default connection.
__construct ( Illuminate\Foundation\Application $app ) : void Create a new database manager instance.
connection ( string $name = null ) : LMongo\Connection Get a database connection instance.
extend ( string $name, callable $resolver ) : void Register an extension connection resolver.
getDefaultConnection ( ) : string Get the default connection name.
reconnect ( string $name = null ) : Connection Reconnect to the given database.
setDefaultConnection ( string $name ) : void Set the default connection name.

Protected Methods

Method Description
getConfig ( string $name ) : array Get the configuration for a connection.
makeConnection ( string $name ) : Connection Make the database connection instance.
prepare ( Connection $connection ) : Connection Prepare the database connection instance.

Method Details

__call() public method

Dynamically pass methods to the default connection.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed

__construct() public method

Create a new database manager instance.
public __construct ( Illuminate\Foundation\Application $app ) : void
$app Illuminate\Foundation\Application
return void

connection() public method

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

extend() public method

Register an extension connection resolver.
public extend ( string $name, callable $resolver ) : void
$name string
$resolver callable
return void

getConfig() protected method

Get the configuration for a connection.
protected getConfig ( string $name ) : array
$name string
return array

getDefaultConnection() public method

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

makeConnection() protected method

Make the database connection instance.
protected makeConnection ( string $name ) : Connection
$name string
return Connection

prepare() protected method

Prepare the database connection instance.
protected prepare ( Connection $connection ) : Connection
$connection Connection
return Connection

reconnect() public method

Reconnect to the given database.
public reconnect ( string $name = null ) : Connection
$name string
return Connection

setDefaultConnection() public method

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

Property Details

$app protected_oe property

The application instance.
protected Application,Illuminate\Foundation $app
return Illuminate\Foundation\Application

$connections protected_oe property

The active connection instances.
protected array $connections
return array

$extensions protected_oe property

The custom connection resolvers.
protected array $extensions
return array