class Propel
Propel's main resource pool and initialization & configuration class.
This static class is used to handle Propel initialization and to maintain all of the
open database connections and instantiated database maps.
Constants
VERSION |
The Propel version. |
DEFAULT_NAME |
A constant for <code>default</code>. |
LOG_EMERG |
A constant defining 'System is unusable' logging level |
LOG_ALERT |
A constant defining 'Immediate action required' logging level |
LOG_CRIT |
A constant defining 'Critical conditions' logging level |
LOG_ERR |
A constant defining 'Error conditions' logging level |
LOG_WARNING |
A constant defining 'Warning conditions' logging level |
LOG_NOTICE |
A constant defining 'Normal but significant' logging level |
LOG_INFO |
A constant defining 'Informational' logging level |
LOG_DEBUG |
A constant defining 'Debug-level messages' logging level |
Methods
static |
init(string $configFile)
Configure Propel using the given config file. |
|
static ServiceContainerInterface |
getServiceContainer()
Get the service container instance. |
|
static |
setServiceContainer(ServiceContainerInterface $serviceContainer)
Set the service container instance. |
|
static string | getDefaultDatasource() | |
static AdapterInterface |
getAdapter(string $name = null)
Get the adapter for a given datasource. |
|
static DatabaseMap |
getDatabaseMap(string $name = null)
Get the database map for a given datasource. |
|
static ConnectionManagerInterface | getConnectionManager(string $name) | |
static |
closeConnections()
Close any associated resource handles. |
|
static ConnectionInterface |
getConnection(string $name = null, string $mode = ServiceContainerInterface::CONNECTION_WRITE)
Get a connection for a given datasource. |
|
static ConnectionInterface |
getWriteConnection(string $name)
Get a write connection for a given datasource. |
|
static ConnectionInterface |
getReadConnection(string $name)
Get a read connection for a given datasource. |
|
static Profiler |
getProfiler()
Get a profiler instance. |
|
static LoggerInterface |
getLogger()
Get the configured logger. |
|
static boolean |
log(string $message, int $level = self::LOG_DEBUG)
Logs a message If a logger has been configured, the logger will be used, otherwise the logging message will be discarded without any further action |
|
static boolean |
disableInstancePooling()
Disable instance pooling. |
|
static boolean |
enableInstancePooling()
Enable instance pooling (enabled by default). |
|
static boolean |
isInstancePoolingEnabled()
the instance pooling behaviour. |
Details
at line 102
static public
init(string $configFile)
Configure Propel using the given config file.
at line 115
static public ServiceContainerInterface
getServiceContainer()
Get the service container instance.
at line 129
static public
setServiceContainer(ServiceContainerInterface $serviceContainer)
Set the service container instance.
at line 137
static public string
getDefaultDatasource()
at line 151
static 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 165
static 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 175
static public ConnectionManagerInterface
getConnectionManager(string $name)
at line 186
static public
closeConnections()
Close any associated resource handles.
This method frees any database connection handles that have been
opened by the getConnection() method.
at line 202
static 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 220
static 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 237
static 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 247
static public Profiler
getProfiler()
Get a profiler instance.
at line 257
static public LoggerInterface
getLogger()
Get the configured logger.
at line 272
static public boolean
log(string $message, int $level = self::LOG_DEBUG)
Logs a message If a logger has been configured, the logger will be used, otherwise the logging message will be discarded without any further action
at line 302
static public boolean
disableInstancePooling()
Disable instance pooling.
at line 318
static public boolean
enableInstancePooling()
Enable instance pooling (enabled by default).
at line 333
static public boolean
isInstancePoolingEnabled()
the instance pooling behaviour.
True by default.