ConnectionFactory
class ConnectionFactory
Properties
protected Container | $container | The IoC container instance. |
Methods
Establish a PDO connection based on the configuration.
Parse and prepare the database configuration.
Create a single database connection instance.
Create a single database connection instance.
Create a new PDO instance for reading.
Get the read configuration for a read / write connection.
Get the read configuration for a read / write connection.
Get a read / write level configuration.
Merge a configuration for a read / write connection.
Create a new Closure that resolves to a PDO instance.
Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts.
Parse the hosts configuration item into an array.
Create a new Closure that resolves to a PDO instance where there is no configured host.
Create a connector instance based on the configuration.
Create a new connection instance.
Details
at line 31
void
__construct(Container $container)
Create a new connection factory instance.
at line 43
Connection
make(array $config, string $name = null)
Establish a PDO connection based on the configuration.
at line 61
protected array
parseConfig(array $config, string $name)
Parse and prepare the database configuration.
at line 72
protected Connection
createSingleConnection(array $config)
Create a single database connection instance.
at line 87
protected Connection
createReadWriteConnection(array $config)
Create a single database connection instance.
at line 100
protected Closure
createReadPdo(array $config)
Create a new PDO instance for reading.
at line 111
protected array
getReadConfig(array $config)
Get the read configuration for a read / write connection.
at line 124
protected array
getWriteConfig(array $config)
Get the read configuration for a read / write connection.
at line 138
protected array
getReadWriteConfig(array $config, string $type)
Get a read / write level configuration.
at line 152
protected array
mergeReadWriteConfig(array $config, array $merge)
Merge a configuration for a read / write connection.
at line 163
protected Closure
createPdoResolver(array $config)
Create a new Closure that resolves to a PDO instance.
at line 176
protected Closure
createPdoResolverWithHosts(array $config)
Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts.
at line 201
protected array
parseHosts(array $config)
Parse the hosts configuration item into an array.
at line 218
protected Closure
createPdoResolverWithoutHosts(array $config)
Create a new Closure that resolves to a PDO instance where there is no configured host.
at line 233
ConnectorInterface
createConnector(array $config)
Create a connector instance based on the configuration.
at line 269
protected Connection
createConnection(string $driver, PDO|Closure $connection, string $database, string $prefix = '', array $config = [])
Create a new connection instance.