DatabaseManager
class DatabaseManager implements ConnectionRegistry (View source)
Properties
protected Application | $app | The application instance. |
|
protected ConnectionFactory | $factory | The database connection factory instance. |
|
protected Connection[] | $connections | The active connection instances. |
|
protected array | $extensions | The custom connection resolvers. |
Methods
Get a 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.
Make the database connection instance.
Get the configuration for a connection.
Get the default connection name.
Set the default connection name.
Register an extension connection resolver.
Return all of the created connections.
Dynamically pass methods to the default connection.
No description
No description
No description
No description
Details
__construct(Application $app, ConnectionFactory $factory)
Create a new database manager instance.
Connection
getActiveConnection()
deprecated
deprecated
Legacy entry point.
Connection
get()
deprecated
deprecated
Legacy entry point.
Connection
connection(string $name = null)
Get a database connection instance.
purge(string $name = null)
Disconnect from the given database and remove from local cache.
disconnect(string $name = null)
Disconnect from the given database.
Connection
reconnect(string $name = null)
Reconnect to the given database.
protected Connection
refreshPdoConnections(string $name)
Refresh the PDO connections on a given connection.
protected Connection
makeConnection(string $name)
Make the database connection instance.
protected Connection
prepare(Connection $connection)
Prepare the database connection instance.
protected array
getConfig(string $name)
Get the configuration for a connection.
string
getDefaultConnection()
Get the default connection name.
setDefaultConnection(string $name)
Set the default connection name.
extend(string $name, callable $resolver)
Register an extension connection resolver.
Connection[]
getConnections()
Return all of the created connections.
mixed
__call(string $method, array $parameters)
Dynamically pass methods to the default connection.
ConnectionFactory
getFactory()
No description
getConnection($name = null)
No description
getConnectionNames()
No description
getDefaultConnectionName()
No description