interface ServiceContainerInterface
Constants
CONNECTION_READ |
Constant used to request a READ connection (applies to replication). |
CONNECTION_WRITE |
Constant used to request a WRITE connection (applies to replication). |
DEFAULT_DATABASE_MAP_CLASS |
The default DatabaseMap class created by getDatabaseMap() |
DEFAULT_DATASOURCE_NAME |
The name of the default datasource. |
DEFAULT_PROFILER_CLASS |
The name of the default Profiler class created by getProfiler() |
Methods
string | getDefaultDatasource() | |
AdapterInterface |
getAdapter(string $name = null)
Get the adapter for a given datasource. |
|
DatabaseMap |
getDatabaseMap(string $name = null)
Get the database map for a given datasource. |
|
ConnectionManagerInterface | getConnectionManager(string $name) | |
closeConnections()
Close any associated resource handles. |
||
ConnectionInterface |
getConnection(string $name = null, string $mode = self::CONNECTION_WRITE)
Get a connection for a given datasource. |
|
ConnectionInterface |
getWriteConnection(string $name)
Get a write connection for a given datasource. |
|
ConnectionInterface |
getReadConnection(string $name)
Get a read connection for a given datasource. |
|
Profiler |
getProfiler()
Get a profiler instance. |
|
LoggerInterface |
getLogger($name = 'defaultLogger')
Get a logger for a given datasource, or the default logger. |
Details
at line 46
public string
getDefaultDatasource()
at line 57
public AdapterInterface
getAdapter(string $name = null)
Get the adapter for a given datasource.
If the adapter does not yet exist, build it using the related adapterClass.
at line 68
public DatabaseMap
getDatabaseMap(string $name = null)
Get the database map for a given datasource.
The database maps are "registered" by the generated map builder classes.
at line 75
public ConnectionManagerInterface
getConnectionManager(string $name)
at line 83
public
closeConnections()
Close any associated resource handles.
This method frees any database connection handles that have been
opened by the getConnection() method.
at line 96
public ConnectionInterface
getConnection(string $name = null, string $mode = self::CONNECTION_WRITE)
Get a connection for a given datasource.
If the connection has not been opened, open it using the related
connectionSettings. If the connection has already been opened, return it.
at line 111
public ConnectionInterface
getWriteConnection(string $name)
Get a write connection for a given datasource.
If the connection has not been opened, open it using the related
connectionSettings. If the connection has already been opened, return it.
at line 125
public ConnectionInterface
getReadConnection(string $name)
Get a read connection for a given datasource.
If the slave connection has not been opened, open it using a random read connection
setting for the related datasource. If no read connection setting exist, return the master
connection. If the slave connection has already been opened, return it.
at line 132
public Profiler
getProfiler()
Get a profiler instance.
at line 139
public LoggerInterface
getLogger($name = 'defaultLogger')
Get a logger for a given datasource, or the default logger.