TSqlMapManager class holds the sqlmap configuation result maps, statements parameter maps and a type handler factory.
Use SqlMapGateway property to obtain the gateway instance used for querying statements defined in the SqlMap configuration files.
- $conn = new TDbConnection($dsn,$dbuser,$dbpass);
- $manager = new TSqlMapManager($conn);
- $manager->configureXml('mydb-sqlmap.xml');
- $sqlmap = $manager->getSqlMapGateway();
- $result = $sqlmap->queryForObject('Products');
| Method Details |
addCacheModel
| public void addCacheModel |
(TSqlMapCacheModel $cacheModel ) |
Adds a named cache.
| Input |
| TSqlMapCacheModel | $cacheModel | the cache to add. |
| Output |
| Exception |
| throws | TSqlMapConfigurationException |
|
addMappedStatement
| public void addMappedStatement |
(IMappedStatement $statement , IMappedStatement 1 ) |
Adds a (named) MappedStatement.
| Input |
| IMappedStatement | $statement | The key name |
| IMappedStatement | 1 | The statement to add |
| Output |
| Exception |
| throws | TSqlMapDuplicateException |
|
addParameterMap
| public void addParameterMap |
(TParameterMap $parameter ) |
| Input |
| TParameterMap | $parameter | add a new parameter map to this SQLMap. |
| Output |
| Exception |
| throws | TSqlMapDuplicateException |
|
addResultMap
| public void addResultMap |
(TResultMap $result ) |
| Input |
| TResultMap | $result | add a new result map to this SQLMap |
| Output |
| Exception |
| throws | TSqlMapDuplicateException |
|
configureXml
| public void configureXml |
(string $file ) |
Loads and parses the SqlMap configuration file.
| Input |
| string | $file | xml configuration file. |
| Output |
| Exception |
|
createSqlMapGateway
Configures the current TSqlMapManager using the given xml configuration file defined in ConfigFile.
| Output |
|
TSqlMapGateway
| create and configure a new TSqlMapGateway. |
| Exception |
|
flushCacheModels
| public void flushCacheModels |
() |
Flushes all cached objects that belong to this SqlMap
|
getCacheDependencies
|
getCacheModel
Gets a cache by name
| Input |
| string | $name | the name of the cache to get. |
| Output |
|
TSqlMapCacheModel
| the cache object. |
| Exception |
| throws | TSqlMapConfigurationException |
|
getDbConnection
|
getMappedStatement
Gets a MappedStatement by name.
| Input |
| string | $name | The name of the statement. |
| Output |
|
IMappedStatement
| The MappedStatement |
| Exception |
| throws | TSqlMapUndefinedException |
|
getMappedStatements
| public TMap getMappedStatements |
() |
| Output |
|
TMap
| mapped statements collection. |
| Exception |
|
getParameterMap
| Input |
| string | $name | parameter map ID name. |
| Output |
|
TParameterMap
| the parameter with given ID. |
| Exception |
| throws | TSqlMapUndefinedException |
|
getParameterMaps
| public TMap getParameterMaps |
() |
| Output |
|
TMap
| parameter maps collection. |
| Exception |
|
getResultMap
Gets a named result map
| Input |
| string | $name | result name. |
| Output |
|
TResultMap
| the result map. |
| Exception |
| throws | TSqlMapUndefinedException |
|
getResultMaps
| public TMap getResultMaps |
() |
| Output |
|
TMap
| result maps collection. |
| Exception |
|
getSqlmapGateway
|
getTypeHandlers
| public TTypeHandlerFactory getTypeHandlers |
() |
| Output |
|
TTypeHandlerFactory
| The TypeHandlerFactory |
| Exception |
|
setDbConnection
| Input |
| TDbConnection | $conn | default database connection |
| Output |
| Exception |
|