\QueryConnectionManager

Connection manager class to manage connections for the Query method

Summary

Methods
Properties
Constants
__clone()
__sleep()
__wakeup()
getInstance()
getConnection()
connect()
parseParams()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
createDsn()
$connections
$instance
N/A

Properties

$connections

$connections : array

Map of named database connections

Type

array

Methods

__clone()

__clone() : void

Private clone method to prevent cloning

Throws

\DomainException

__sleep()

__sleep() : void

Prevent serialization of this object

Throws

\DomainException

__wakeup()

__wakeup() : void

Make sure serialize/deserialize doesn't work

Throws

\DomainException

getInstance()

getInstance() : \Query\ConnectionManager

Return a connection manager instance

Returns

\Query\ConnectionManager

getConnection()

getConnection(string|array|object  $name = '') : \Query\QueryBuilderInterface

Returns the connection specified by the name given

Parameters

string|array|object $name

Throws

\InvalidArgumentException

Returns

\Query\QueryBuilderInterface

connect()

connect(\stdClass  $params) : \Query\QueryBuilderInterface

Parse the passed parameters and return a connection

Parameters

\stdClass $params

Returns

\Query\QueryBuilderInterface

parseParams()

parseParams(\stdClass  $params) : array

Parses params into a dsn and option array

Parameters

\stdClass $params

Throws

\Query\BadDBDriverException

Returns

array

__construct()

__construct() 

Private constructor to prevent multiple instances

createDsn()

createDsn(string  $dbtype, \stdClass  $params) : string

Create the dsn from the db type and params

Parameters

string $dbtype
\stdClass $params

Returns

string