\Phinx\Db\AdapterAdapterFactory

Adapter factory and registry.

Used for registering adapters and creating instances of adapters.

Summary

Methods
Properties
Constants
instance()
registerAdapter()
getAdapter()
registerWrapper()
getWrapper()
No public properties found
No constants found
getClass()
getWrapperClass()
$instance
$adapters
$wrappers
N/A
No private methods found
No private properties found
N/A

Properties

$adapters

$adapters : array

Class map of database adapters, indexed by PDO::ATTR_DRIVER_NAME.

Type

array

$wrappers

$wrappers : array

Class map of adapters wrappers, indexed by name.

Type

array

Methods

registerAdapter()

registerAdapter(string  $name, string  $class) : $this

Add or replace an adapter with a fully qualified class name.

Parameters

string $name
string $class

Throws

\RuntimeException

Returns

$this

getAdapter()

getAdapter(string  $name, array  $options) : \Phinx\Db\Adapter\AdapterInterface

Get an adapter instance by name.

Parameters

string $name
array $options

Returns

\Phinx\Db\Adapter\AdapterInterface

registerWrapper()

registerWrapper(string  $name, string  $class) : $this

Add or replace a wrapper with a fully qualified class name.

Parameters

string $name
string $class

Throws

\RuntimeException

Returns

$this

getClass()

getClass(string  $name) : string

Get an adapter class by name.

Parameters

string $name

Throws

\RuntimeException

Returns

string

getWrapperClass()

getWrapperClass(string  $name) : string

Get a wrapper class by name.

Parameters

string $name

Throws

\RuntimeException

Returns

string