- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TDiscriminator
TInlineParameterMapParser
TParameterMap
TParameterProperty
TResultMap
TResultProperty
TSimpleDynamicParser
TSqlMapCacheKey
TSqlMapCacheModel
TSqlMapCacheTypes
TSqlMapDelete
TSqlMapInsert
TSqlMapSelectKey
TSqlMapStatement
TSqlMapUpdate
TSqlMapXmlConfigBuilder
TSqlMapXmlConfiguration
TSqlMapXmlMappingConfiguration
TSubMap

Keyword

# Class TResultMap

    TComponent
       |
       --TResultMap

TResultMap corresponds to <resultMap> mapping tag.

A TResultMap lets you control how data is extracted from the result of a query, and how the columns are mapped to object properties. A TResultMap can describe the column type, a null value replacement, and complex property mappings including Collections.

The <resultMap> can contain any number of property mappings that map object properties to the columns of a result element. The property mappings are applied, and the columns are read, in the order that they are defined. Maintaining the element order ensures consistent results between different drivers and providers.

The Class property must be a PHP class object or array instance.

The optional Extends attribute can be set to the ID of another <resultMap> upon which to base this <resultMap>. All properties of the "parent" <resultMap> will be included as part of this <resultMap>, and values from the "parent" <resultMap> are set before any values specified by this <resultMap>.

Since: 3.1
Author: Wei Zhuo <weizho[at]gmail[dot]com>

Constructor Summary
public | __construct Initialize the columns collection.

Method Summary
void | addResultProperty ( TResultProperty $property) Add a TResultProperty to result mapping.
mixed | createInstanceOfResult ( TSqlMapTypeHandlerRegistry $registry) Create a new instance of the class of this result map.
string | getClass ()
TMap | getColumns ()
TDiscriminator | getDiscriminator ()
string | getExtends ()
string | getGroupBy ()
string | getID ()
TResultMap | resolveSubMap ( TSqlMapTypeHandlerRegistry $registry, array $row) Result sub-mappings using the discriminiator column.
void | setClass ( string $value)
void | setDiscriminator ( TDiscriminator $value)
void | setExtends ( string $value)
void | setGroupBy ( string $value)
void | setID ( string $value)

Methods Inherited From TComponent

TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constructor Details

## __construct

public __construct |

Initialize the columns collection.

Method Details

## addResultProperty

public void addResultProperty | (TResultProperty $property )

Add a TResultProperty to result mapping.

Input
TResultProperty | $property | result property.
Output
Exception

## createInstanceOfResult

public mixed createInstanceOfResult | (TSqlMapTypeHandlerRegistry $registry )

Create a new instance of the class of this result map.

Input
TSqlMapTypeHandlerRegistry | $registry | type handler registry.
Output
mixed | new result object.
Exception
throws | TSqlMapException

## getClass

public string getClass | ()

Output
string | result class name.
Exception

## getColumns

public TMap getColumns | ()

Output
TMap | result columns.
Exception

## getDiscriminator

public TDiscriminator getDiscriminator | ()

Output
TDiscriminator | result class discriminator.
Exception

## getExtends

public string getExtends | ()

Output
string | result map extends another result map.
Exception

## getGroupBy

public string getGroupBy | ()

Output
string | result map groups by.
Exception

## getID

public string getID | ()

Output
string | a unique identifier for the <resultMap>.
Exception

## resolveSubMap

public TResultMap resolveSubMap | (TSqlMapTypeHandlerRegistry $registry , array $row )

Result sub-mappings using the discriminiator column.

Input
TSqlMapTypeHandlerRegistry | $registry | type handler registry
array | $row | row data.
Output
TResultMap | result sub-map.
Exception

## setClass

public void setClass | (string $value )

Input
string | $value | result class name.
Output
Exception

## setDiscriminator

public void setDiscriminator | (TDiscriminator $value )

Input
TDiscriminator | $value | result class discriminator.
Output
Exception

## setExtends

public void setExtends | (string $value )

Input
string | $value | result map extends another result map.
Output
Exception

## setGroupBy

public void setGroupBy | (string $value )

Input
string | $value | result map group by
Output
Exception

## setID

public void setID | (string $value )

Input
string | $value | a unique identifier for the <resultMap>.
Output
Exception