ConnectionFactory
Properties
Methods
__construct ( Container $container ) : void
Create a new connection factory instance.
Parameters
- $container Container
make ( array $config , $name ) : Connection
Establish a PDO connection based on the configuration.
Parameters
- $config array
- $name string|null
parseConfig ( array $config , $name ) : array
Parse and prepare the database configuration.
Parameters
- $config array
- $name string
createSingleConnection ( array $config ) : Connection
Create a single database connection instance.
Parameters
- $config array
createReadWriteConnection ( array $config ) : Connection
Create a read / write database connection instance.
Parameters
- $config array
createReadPdo ( array $config ) : Closure
Create a new PDO instance for reading.
Parameters
- $config array
getReadConfig ( array $config ) : array
Get the read configuration for a read / write connection.
Parameters
- $config array
getWriteConfig ( array $config ) : array
Get the write configuration for a read / write connection.
Parameters
- $config array
getReadWriteConfig ( array $config , $type ) : array
Get a read / write level configuration.
Parameters
- $config array
- $type string
mergeReadWriteConfig ( array $config , array $merge ) : array
Merge a configuration for a read / write connection.
Parameters
- $config array
- $merge array
createPdoResolver ( array $config ) : Closure
Create a new Closure that resolves to a PDO instance.
Parameters
- $config array
createPdoResolverWithHosts ( array $config ) : Closure
Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts.
Parameters
- $config array
parseHosts ( array $config ) : array
Parse the hosts configuration item into an array.
Parameters
- $config array
createPdoResolverWithoutHosts ( array $config ) : Closure
Create a new Closure that resolves to a PDO instance where there is no configured host.
Parameters
- $config array
createConnector ( array $config ) : ConnectorInterface
Create a connector instance based on the configuration.
Parameters
- $config array
createConnection ( $driver , $connection , $database , $prefix , array $config ) : Connection
Create a new connection instance.