DatabaseManager
in package
implements
ConnectionResolverInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- $app : Application
- The application instance.
- $connections : array<string|int, mixed>
- The active connection instances.
- $extensions : array<string|int, mixed>
- The custom connection resolvers.
- $factory : ConnectionFactory
- The database connection factory instance.
- __call() : mixed
- Dynamically pass methods to the default connection.
- __construct() : void
- Create a new database manager instance.
- availableDrivers() : array<string|int, mixed>
- Get all of the drivers that are actually available.
- connection() : Connection
- Get a database connection instance.
- disconnect() : void
- Disconnect from the given database.
- extend() : void
- Register an extension connection resolver.
- getConnections() : array<string|int, mixed>
- Return all of the created connections.
- getDefaultConnection() : string
- Get the default connection name.
- purge() : void
- Disconnect from the given database and remove from local cache.
- reconnect() : Connection
- Reconnect to the given database.
- setDefaultConnection() : void
- Set the default connection name.
- supportedDrivers() : array<string|int, mixed>
- Get all of the support drivers.
- configuration() : array<string|int, mixed>
- Get the configuration for a connection.
- configure() : Connection
- Prepare the database connection instance.
- makeConnection() : Connection
- Make the database connection instance.
- parseConnectionName() : array<string|int, mixed>
- Parse the connection into an array of the name and read / write type.
- refreshPdoConnections() : Connection
- Refresh the PDO connections on a given connection.
- setPdoForType() : Connection
- Prepare the read / write mode for database connection instance.
Properties
$app
The application instance.
protected
Application
$app
$connections
The active connection instances.
protected
array<string|int, mixed>
$connections
= []
$extensions
The custom connection resolvers.
protected
array<string|int, mixed>
$extensions
= []
$factory
The database connection factory instance.
protected
ConnectionFactory
$factory
Methods
__call()
Dynamically pass methods to the default connection.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
mixed —__construct()
Create a new database manager instance.
public
__construct(Application $app, ConnectionFactory $factory) : void
Parameters
- $app : Application
- $factory : ConnectionFactory
Return values
void —availableDrivers()
Get all of the drivers that are actually available.
public
availableDrivers() : array<string|int, mixed>
Return values
array<string|int, mixed> —connection()
Get a database connection instance.
public
connection([string $name = null ]) : Connection
Parameters
- $name : string = null
Return values
Connection —disconnect()
Disconnect from the given database.
public
disconnect([string $name = null ]) : void
Parameters
- $name : string = null
Return values
void —extend()
Register an extension connection resolver.
public
extend(string $name, callable $resolver) : void
Parameters
- $name : string
- $resolver : callable
Return values
void —getConnections()
Return all of the created connections.
public
getConnections() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDefaultConnection()
Get the default connection name.
public
getDefaultConnection() : string
Return values
string —purge()
Disconnect from the given database and remove from local cache.
public
purge([string $name = null ]) : void
Parameters
- $name : string = null
Return values
void —reconnect()
Reconnect to the given database.
public
reconnect([string $name = null ]) : Connection
Parameters
- $name : string = null
Return values
Connection —setDefaultConnection()
Set the default connection name.
public
setDefaultConnection(string $name) : void
Parameters
- $name : string
Return values
void —supportedDrivers()
Get all of the support drivers.
public
supportedDrivers() : array<string|int, mixed>
Return values
array<string|int, mixed> —configuration()
Get the configuration for a connection.
protected
configuration(string $name) : array<string|int, mixed>
Parameters
- $name : string
Tags
Return values
array<string|int, mixed> —configure()
Prepare the database connection instance.
protected
configure(Connection $connection, string $type) : Connection
Parameters
- $connection : Connection
- $type : string
Return values
Connection —makeConnection()
Make the database connection instance.
protected
makeConnection(string $name) : Connection
Parameters
- $name : string
Return values
Connection —parseConnectionName()
Parse the connection into an array of the name and read / write type.
protected
parseConnectionName(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed> —refreshPdoConnections()
Refresh the PDO connections on a given connection.
protected
refreshPdoConnections(string $name) : Connection
Parameters
- $name : string
Return values
Connection —setPdoForType()
Prepare the read / write mode for database connection instance.
protected
setPdoForType(Connection $connection[, string $type = null ]) : Connection
Parameters
- $connection : Connection
- $type : string = null