DatabaseManager
class DatabaseManager implements ConnectionResolverInterface mixin Connection
Properties
protected Application | $app | The application instance. |
|
protected ConnectionFactory | $factory | The database connection factory instance. |
|
protected array | $connections | The active connection instances. |
|
protected array | $extensions | The custom connection resolvers. |
Methods
Get a database connection instance.
Parse the connection into an array of the name and read / write type.
Make the database connection instance.
Get the configuration for a connection.
Prepare the read / write mode for database connection instance.
Disconnect from the given database and remove from local cache.
Disconnect from the given database.
Reconnect to the given database.
Refresh the PDO connections on a given connection.
Get the default connection name.
Set the default connection name.
Get all of the support drivers.
Get all of the drivers that are actually available.
Register an extension connection resolver.
Return all of the created connections.
Dynamically pass methods to the default connection.
Details
at line 51
void
__construct(Application $app, ConnectionFactory $factory)
Create a new database manager instance.
at line 63
ConnectionInterface
connection(string $name = null)
Get a database connection instance.
at line 87
protected array
parseConnectionName(string $name)
Parse the connection into an array of the name and read / write type.
at line 101
protected Connection
makeConnection(string $name)
Make the database connection instance.
at line 130
protected array
configuration(string $name)
Get the configuration for a connection.
at line 153
protected Connection
configure(Connection $connection, string $type)
Prepare the database connection instance.
at line 181
protected Connection
setPdoForType(Connection $connection, string $type = null)
Prepare the read / write mode for database connection instance.
at line 198
void
purge(string $name = null)
Disconnect from the given database and remove from local cache.
at line 213
void
disconnect(string $name = null)
Disconnect from the given database.
at line 226
Connection
reconnect(string $name = null)
Reconnect to the given database.
at line 243
protected Connection
refreshPdoConnections(string $name)
Refresh the PDO connections on a given connection.
at line 257
string
getDefaultConnection()
Get the default connection name.
at line 268
void
setDefaultConnection(string $name)
Set the default connection name.
at line 278
array
supportedDrivers()
Get all of the support drivers.
at line 288
array
availableDrivers()
Get all of the drivers that are actually available.
at line 303
void
extend(string $name, callable $resolver)
Register an extension connection resolver.
at line 313
array
getConnections()
Return all of the created connections.
at line 325
mixed
__call(string $method, array $parameters)
Dynamically pass methods to the default connection.