\Gishiki\DatabaseDatabaseManager

Represent the database manager of the entire framework.

Summary

Methods
Properties
Constants
connect()
retrieve()
No public properties found
ADAPTERS_MAP
No protected methods found
$connections
N/A
No private methods found
No private properties found
N/A

Constants

ADAPTERS_MAP

ADAPTERS_MAP

Properties

$connections

$connections : array

Type

array — the list of database connections as an associative array

Methods

connect()

connect(string  $connectionName, string  $connectionString) : \Gishiki\Database\DatabaseInterface

Create a new database connection and store the newly generated connection.

Parameters

string $connectionName

the name of the database connection

string $connectionString

the connection string

Throws

\InvalidArgumentException

invalid name or connection string

\Gishiki\Database\DatabaseException

the error occurred while opening the database connection

\Gishiki\Database\Adapters\Utils\ConnectionParser\ConnectionParserException

a database adapter with the given name doesn't exists

Returns

\Gishiki\Database\DatabaseInterface

the connected database instance

retrieve()

retrieve(string  $connectionName = 'default') : \Gishiki\Database\DatabaseInterface

Retrieve the connection with the given name from the list of performed conenctions.

If the name is not specified the default one is retrieved.

Parameters

string $connectionName

the name of the selected connection

Throws

\InvalidArgumentException

the collection name has not be given as a string

\Gishiki\Database\DatabaseException

the given connection name is not registered as a valid collection

Returns

\Gishiki\Database\DatabaseInterface

the connected database instance