\app\framework\Component\Database\ConnectionConnectionFactory

Summary

Methods
Properties
Constants
make()
No public properties found
defaultConfigElements
No protected methods found
No protected properties found
N/A
parseConfig()
createSingleConnection()
createPdoInstance()
createConnection()
No private properties found
N/A

Constants

defaultConfigElements

defaultConfigElements

Methods

make()

make(  $name = null) : \app\framework\Component\Database\Connection\Connection

Establish a PDO connection based on the configuration.

Set up default connection or the one defined

Parameters

$name

String Name of the connection. If null use default.

Returns

\app\framework\Component\Database\Connection\Connection

parseConfig()

parseConfig(array  $config, string  $name) : array

To be sure that the config array is as he is supposed to be.

Parameters

array $config
string $name

Throws

\Exception

If config does not exist.

Returns

array —

the connection config

createSingleConnection()

createSingleConnection(array  $config, string  $name = '') : \app\framework\Component\Database\Connection\Connection

Create a single database connection instance.

Parameters

array $config
string $name

Returns

\app\framework\Component\Database\Connection\Connection

createPdoInstance()

createPdoInstance(array  $config) : \PDO

Parameters

array $config

Returns

\PDO

createConnection()

createConnection(\PDO  $Pdo, string  $database = "", string  $name = '', array  $config = array()) : \app\framework\Component\Database\Connection\Connection

Parameters

\PDO $Pdo
string $database
string $name
array $config

Returns

\app\framework\Component\Database\Connection\Connection