PHP Class Prado\Data\SqlMap\TSqlMapManager

Use {@link SqlMapGateway getSqlMapGateway()} 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');
Since: 3.1
Inheritance: extends Prado\TComponent
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $connection = null ) Constructor, create a new SqlMap manager.
addCacheModel ( TSqlMapCacheModel $cacheModel ) Adds a named cache.
addMappedStatement ( Prado\Data\SqlMap\Statements\IMappedStatement $statement ) Adds a (named) MappedStatement.
addParameterMap ( TParameterMap $parameter )
addResultMap ( TResultMap $result )
configureXml ( $file ) Loads and parses the SqlMap configuration file.
flushCacheModels ( ) Flushes all cached objects that belong to this SqlMap
getCacheDependencies ( ) : TChainedCacheDependency
getCacheModel ( $name ) : TSqlMapCacheModel Gets a cache by name
getDbConnection ( ) : TDbConnection
getMappedStatement ( $name ) : Prado\Data\SqlMap\Statements\IMappedStatement Gets a MappedStatement by name.
getMappedStatements ( ) : TMap
getParameterMap ( $name ) : TParameterMap
getParameterMaps ( ) : TMap
getResultMap ( $name ) : TResultMap Gets a named result map
getResultMaps ( ) : TMap
getSqlmapGateway ( ) : TSqlMapGateway
getTypeHandlers ( ) : TTypeHandlerFactory
setDbConnection ( $conn )

Méthodes protégées

Méthode Description
createSqlMapGateway ( ) : TSqlMapGateway Configures the current TSqlMapManager using the given xml configuration file defined in {@link ConfigFile setConfigFile()}.

Method Details

__construct() public méthode

Constructor, create a new SqlMap manager.
public __construct ( $connection = null )

addCacheModel() public méthode

Adds a named cache.
public addCacheModel ( TSqlMapCacheModel $cacheModel )
$cacheModel Prado\Data\SqlMap\Configuration\TSqlMapCacheModel

addMappedStatement() public méthode

Adds a (named) MappedStatement.
public addMappedStatement ( Prado\Data\SqlMap\Statements\IMappedStatement $statement )
$statement Prado\Data\SqlMap\Statements\IMappedStatement

addParameterMap() public méthode

public addParameterMap ( TParameterMap $parameter )
$parameter Prado\Data\SqlMap\Configuration\TParameterMap

addResultMap() public méthode

public addResultMap ( TResultMap $result )
$result Prado\Data\SqlMap\Configuration\TResultMap

configureXml() public méthode

Loads and parses the SqlMap configuration file.
public configureXml ( $file )

createSqlMapGateway() protected méthode

Configures the current TSqlMapManager using the given xml configuration file defined in {@link ConfigFile setConfigFile()}.
protected createSqlMapGateway ( ) : TSqlMapGateway
Résultat TSqlMapGateway create and configure a new TSqlMapGateway.

flushCacheModels() public méthode

Flushes all cached objects that belong to this SqlMap
public flushCacheModels ( )

getCacheDependencies() public méthode

Since: 3.1.5
public getCacheDependencies ( ) : TChainedCacheDependency
Résultat Prado\Caching\TChainedCacheDependency

getCacheModel() public méthode

Gets a cache by name
public getCacheModel ( $name ) : TSqlMapCacheModel
Résultat Prado\Data\SqlMap\Configuration\TSqlMapCacheModel the cache object.

getDbConnection() public méthode

public getDbConnection ( ) : TDbConnection
Résultat TDbConnection default database connection

getMappedStatement() public méthode

Gets a MappedStatement by name.
public getMappedStatement ( $name ) : Prado\Data\SqlMap\Statements\IMappedStatement
Résultat Prado\Data\SqlMap\Statements\IMappedStatement The MappedStatement

getMappedStatements() public méthode

public getMappedStatements ( ) : TMap
Résultat Prado\Collections\TMap mapped statements collection.

getParameterMap() public méthode

public getParameterMap ( $name ) : TParameterMap
Résultat Prado\Data\SqlMap\Configuration\TParameterMap the parameter with given ID.

getParameterMaps() public méthode

public getParameterMaps ( ) : TMap
Résultat Prado\Collections\TMap parameter maps collection.

getResultMap() public méthode

Gets a named result map
public getResultMap ( $name ) : TResultMap
Résultat Prado\Data\SqlMap\Configuration\TResultMap the result map.

getResultMaps() public méthode

public getResultMaps ( ) : TMap
Résultat Prado\Collections\TMap result maps collection.

getSqlmapGateway() public méthode

public getSqlmapGateway ( ) : TSqlMapGateway
Résultat TSqlMapGateway SqlMap gateway.

getTypeHandlers() public méthode

public getTypeHandlers ( ) : TTypeHandlerFactory
Résultat TTypeHandlerFactory The TypeHandlerFactory

setDbConnection() public méthode

public setDbConnection ( $conn )