$conn = new TDbConnection($dsn,$dbuser,$dbpass);
$manager = new TSqlMapManager($conn);
$manager->configureXml('mydb-sqlmap.xml');
$sqlmap = $manager->getSqlMapGateway();
$result = $sqlmap->queryForObject('Products');
Afficher le fichier
Open project: pradosoft/prado
Class Usage Examples
Méthode | Description | |
---|---|---|
__construct ( $connection = null ) | Constructor, create a new SqlMap manager. | |
addCacheModel ( |
Adds a named cache. | |
addMappedStatement ( Prado\Data\SqlMap\Statements\IMappedStatement $statement ) | Adds a (named) MappedStatement. | |
addParameterMap ( |
||
addResultMap ( |
||
configureXml ( $file ) | Loads and parses the SqlMap configuration file. | |
flushCacheModels ( ) | Flushes all cached objects that belong to this SqlMap | |
getCacheDependencies ( ) : |
||
getCacheModel ( $name ) : |
Gets a cache by name | |
getDbConnection ( ) : TDbConnection | ||
getMappedStatement ( $name ) : Prado\Data\SqlMap\Statements\IMappedStatement | Gets a MappedStatement by name. | |
getMappedStatements ( ) : |
||
getParameterMap ( $name ) : |
||
getParameterMaps ( ) : |
||
getResultMap ( $name ) : |
Gets a named result map | |
getResultMaps ( ) : |
||
getSqlmapGateway ( ) : |
||
getTypeHandlers ( ) : TTypeHandlerFactory | ||
setDbConnection ( $conn ) |
Méthode | Description | |
---|---|---|
createSqlMapGateway ( ) : |
Configures the current TSqlMapManager using the given xml configuration file defined in {@link ConfigFile setConfigFile()}. |
public __construct ( $connection = null ) |
public addCacheModel ( |
||
$cacheModel |
public addMappedStatement ( Prado\Data\SqlMap\Statements\IMappedStatement $statement ) | ||
$statement | Prado\Data\SqlMap\Statements\IMappedStatement |
public addParameterMap ( |
||
$parameter |
public addResultMap ( |
||
$result |
public configureXml ( $file ) |
protected createSqlMapGateway ( ) : |
||
Résultat | create and configure a new TSqlMapGateway. |
public flushCacheModels ( ) |
public getCacheDependencies ( ) : |
||
Résultat |
public getCacheModel ( $name ) : |
||
Résultat | the cache object. |
public getDbConnection ( ) : TDbConnection | ||
Résultat | TDbConnection | default database connection |
public getMappedStatement ( $name ) : Prado\Data\SqlMap\Statements\IMappedStatement | ||
Résultat | Prado\Data\SqlMap\Statements\IMappedStatement | The MappedStatement |
public getMappedStatements ( ) : |
||
Résultat | mapped statements collection. |
public getParameterMap ( $name ) : |
||
Résultat | the parameter with given ID. |
public getParameterMaps ( ) : |
||
Résultat | parameter maps collection. |
public getResultMap ( $name ) : |
||
Résultat | the result map. |
public getResultMaps ( ) : |
||
Résultat | result maps collection. |
public getSqlmapGateway ( ) : |
||
Résultat | SqlMap gateway. |
public getTypeHandlers ( ) : TTypeHandlerFactory | ||
Résultat | TTypeHandlerFactory | The TypeHandlerFactory |