class StandardServiceContainer implements ServiceContainerInterface
Methods
string | getDefaultDatasource() | |
setDefaultDatasource(string $defaultDatasource) | ||
string |
getAdapterClass(string $name = null)
Get the adapter class for a given datasource. |
|
setAdapterClass(string $name, string $adapterClass)
Set the adapter class for a given datasource. |
||
setAdapterClasses(array $adapterClasses)
Reset existing adapters classes and set new classes for all datasources. |
||
AdapterInterface |
getAdapter(string $name = null)
Get the adapter for a given datasource. |
|
setAdapter(string $name, AdapterInterface $adapter)
Set the adapter for a given datasource. |
||
setAdapters(array $adapters)
Reset existing adapters and set new adapters for all datasources. |
||
checkVersion(string $generatorVersion)
check whether the given propel generator version has the same version as the propel runtime. |
||
setDatabaseMapClass(string $databaseMapClass) | ||
DatabaseMap |
getDatabaseMap(string $name = null)
Get the database map for a given datasource. |
|
setDatabaseMap(string $name, DatabaseMap $databaseMap)
Set the database map object to use for a given datasource. |
||
setConnectionManager(string $name, ConnectionManagerInterface $manager) | ||
ConnectionManagerInterface | getConnectionManager(string $name) | |
ConnectionManagerInterface] | getConnectionManagers() | |
closeConnections()
Close any associated resource handles. |
||
ConnectionInterface |
getConnection(string $name = null, string $mode = ServiceContainerInterface::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. |
|
setConnection(string $name, ConnectionInterface $connection)
Shortcut to define a single connection for a datasource. |
||
setProfilerClass(string $profilerClass)
Override the default profiler class. |
||
setProfilerConfiguration(array $profilerConfiguration)
Set the profiler configuration. |
||
setProfiler(Profiler $profiler)
Set the profiler instance. |
||
Profiler |
getProfiler()
Get a profiler instance. |
|
LoggerInterface |
getLogger($name = 'defaultLogger')
Get a logger instance |
|
setLogger(string $name, LoggerInterface $logger) | ||
setLoggerConfiguration(string $name, array $loggerConfiguration)
Set the configuration for the logger of a given datasource. |
Details
at line 86
public string
getDefaultDatasource()
at line 94
public
setDefaultDatasource(string $defaultDatasource)
at line 106
public string
getAdapterClass(string $name = null)
Get the adapter class for a given datasource.
at line 123
public
setAdapterClass(string $name, string $adapterClass)
Set the adapter class for a given datasource.
This allows for lazy-loading adapter objects in getAdapter().
at line 134
public
setAdapterClasses(array $adapterClasses)
Reset existing adapters classes and set new classes for all datasources.
at line 151
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 172
public
setAdapter(string $name, AdapterInterface $adapter)
Set the adapter for a given datasource.
at line 183
public
setAdapters(array $adapters)
Reset existing adapters and set new adapters for all datasources.
at line 198
public
checkVersion(string $generatorVersion)
check whether the given propel generator version has the same version as the propel runtime.
at line 216
public
setDatabaseMapClass(string $databaseMapClass)
at line 230
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 249
public
setDatabaseMap(string $name, DatabaseMap $databaseMap)
Set the database map object to use for a given datasource.
at line 258
public
setConnectionManager(string $name, ConnectionManagerInterface $manager)
at line 274
public ConnectionManagerInterface
getConnectionManager(string $name)
at line 282
public ConnectionManagerInterface]
getConnectionManagers()
at line 293
public
closeConnections()
Close any associated resource handles.
This method frees any database connection handles that have been
opened by the getConnection() method.
at line 311
public ConnectionInterface
getConnection(string $name = null, string $mode = ServiceContainerInterface::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 337
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 354
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 365
public
setConnection(string $name, ConnectionInterface $connection)
Shortcut to define a single connection for a datasource.
at line 380
public
setProfilerClass(string $profilerClass)
Override the default profiler class.
The service container uses this class to instantiate a new profiler when
getProfiler() is called.
at line 392
public
setProfilerConfiguration(array $profilerConfiguration)
Set the profiler configuration.
at line 403
public
setProfiler(Profiler $profiler)
Set the profiler instance.
at line 415
public Profiler
getProfiler()
Get a profiler instance.
If no profiler is set, create one using profilerClass and profilerConfiguration.
at line 434
public LoggerInterface
getLogger($name = 'defaultLogger')
Get a logger instance
at line 447
public
setLogger(string $name, LoggerInterface $logger)
at line 514
public
setLoggerConfiguration(string $name, array $loggerConfiguration)
Set the configuration for the logger of a given datasource.
A logger configuration must contain a 'handlers' key defining one
or more handlers of type stream, rotating_file, or syslog.
You can also create more complex loggers by hand and set them directly
using setLogger().