class ConnectionManager extends Singleton (View source)

Singleton to manage any and all database connections.

Methods

static object
instance()

Static method for instantiating a singleton object.

from Singleton
string
get_called_class()

Similar to a get_called_class() for a child class to invoke.

from Singleton
static Connection
get_connection(string $name = null)

If $name is null then the default connection will be returned.

static 
drop_connection(string $name = null)

Drops the connection from the connection manager. Does not actually close it since there is no close method in PDO.

Details

final static object instance()

Static method for instantiating a singleton object.

Return Value

object

final protected string get_called_class()

Similar to a get_called_class() for a child class to invoke.

Return Value

string

static Connection get_connection(string $name = null)

If $name is null then the default connection will be returned.

Parameters

string $name Optional name of a connection

Return Value

Connection

See also

Config

static drop_connection(string $name = null)

Drops the connection from the connection manager. Does not actually close it since there is no close method in PDO.

If $name is null then the default connection will be returned.

Parameters

string $name Name of the connection to forget about