PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TSqlMapManager

TSqlMapManager class holds the sqlmap configuation result maps, statements parameter maps and a type handler factory.

Use 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');
TComponent
Extended by TSqlMapManager
Package: System\Data\SqlMap
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>
Since: 3.1
Located at Data/SqlMap/TSqlMapManager.php
Methods summary
public
# __construct( TDbConnection $connection = null )

Constructor, create a new SqlMap manager.

Constructor, create a new SqlMap manager.

Parameters

$connection
TDbConnection
database connection

Overrides

TComponent::__construct()
public
# setDbConnection( TDbConnection $conn )

Parameters

$conn
TDbConnection
default database connection
public TDbConnection
# getDbConnection( )

Returns

TDbConnection
default database connection
public TTypeHandlerFactory
# getTypeHandlers( )

Returns

TTypeHandlerFactory
The TypeHandlerFactory
public TSqlMapGateway
# getSqlmapGateway( )

Returns

TSqlMapGateway
SqlMap gateway.
public
# configureXml( string $file )

Loads and parses the SqlMap configuration file.

Loads and parses the SqlMap configuration file.

Parameters

$file
string
xml configuration file.
public TChainedCacheDependency
# getCacheDependencies( )

Returns

TChainedCacheDependency

Since

3.1.5
protected TSqlMapGateway
# createSqlMapGateway( )

Configures the current TSqlMapManager using the given xml configuration file defined in ConfigFile setConfigFile().

Configures the current TSqlMapManager using the given xml configuration file defined in ConfigFile setConfigFile().

Returns

TSqlMapGateway
create and configure a new TSqlMapGateway.
public TMap
# getMappedStatements( )

Returns

TMap
mapped statements collection.
public IMappedStatement
# getMappedStatement( string $name )

Gets a MappedStatement by name.

Gets a MappedStatement by name.

Parameters

$name
string
The name of the statement.

Returns

IMappedStatement
The MappedStatement

Throws

TSqlMapUndefinedException
public
# addMappedStatement( IMappedStatement $statement )

Adds a (named) MappedStatement.

Adds a (named) MappedStatement.

Parameters

$statement
string
The key name

Throws

TSqlMapDuplicateException
public TMap
# getResultMaps( )

Returns

TMap
result maps collection.
public TResultMap
# getResultMap( string $name )

Gets a named result map

Gets a named result map

Parameters

$name
string
result name.

Returns

TResultMap
the result map.

Throws

TSqlMapUndefinedException
public
# addResultMap( TResultMap $result )

Parameters

$result
TResultMap
add a new result map to this SQLMap

Throws

TSqlMapDuplicateException
public TMap
# getParameterMaps( )

Returns

TMap
parameter maps collection.
public TParameterMap
# getParameterMap( string $name )

Parameters

$name
string
parameter map ID name.

Returns

TParameterMap
the parameter with given ID.

Throws

TSqlMapUndefinedException
public
# addParameterMap( TParameterMap $parameter )

Parameters

$parameter
TParameterMap
add a new parameter map to this SQLMap.

Throws

TSqlMapDuplicateException
public
# addCacheModel( TSqlMapCacheModel $cacheModel )

Adds a named cache.

Adds a named cache.

Parameters

$cacheModel
TSqlMapCacheModel
the cache to add.

Throws

TSqlMapConfigurationException
public TSqlMapCacheModel
# getCacheModel( string $name )

Gets a cache by name

Gets a cache by name

Parameters

$name
string
the name of the cache to get.

Returns

TSqlMapCacheModel
the cache object.

Throws

TSqlMapConfigurationException
public
# flushCacheModels( )

Flushes all cached objects that belong to this SqlMap

Flushes all cached objects that belong to this SqlMap

Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO