## Class TResultMap

Description

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
- version: $Id: TResultMap.php 1566 2006-12-05 23:37:07Z wei $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/SqlMap/Configuration/TResultMap.php (line 39)

    TComponent
       |
       --TResultMap

Method Summary
TResultMap __construct ()
void addResultProperty (TResultProperty $property)
mixed createInstanceOfResult (TSqlMapTypeHandlerRegistry $registry)
string getClass ()
TMap getColumns ()
TDiscriminator getDiscriminator ()
string getExtends ()
string getGroupBy ()
string getID ()
TResultMap resolveSubMap (TSqlMapTypeHandlerRegistry $registry, array $row)
void setClass (string $value)
void setDiscriminator (TDiscriminator $value)
void setExtends (string $value)
void setGroupBy (string $value)
void setID (string $value)
Methods
Constructor __construct (line 52)

Initialize the columns collection.

- access: public

TResultMap __construct ()
addResultProperty (line 149)

Add a TResultProperty to result mapping.

- access: public

void addResultProperty (TResultProperty $property)

- TResultProperty $property: result property.

createInstanceOfResult (line 160)

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

- return: new result object.
- access: public
- throws: TSqlMapException

mixed createInstanceOfResult (TSqlMapTypeHandlerRegistry $registry)

- TSqlMapTypeHandlerRegistry $registry: type handler registry.

getClass (line 76)

- return: result class name.
- access: public

string getClass ()
getColumns (line 92)

- return: result columns.
- access: public

TMap getColumns ()
getDiscriminator (line 132)

- return: result class discriminator.
- access: public

TDiscriminator getDiscriminator ()
getExtends (line 100)

- return: result map extends another result map.
- access: public

string getExtends ()
getGroupBy (line 116)

- return: result map groups by.
- access: public

string getGroupBy ()
getID (line 60)

- return: a unique identifier for the <resultMap>.
- access: public

string getID ()
resolveSubMap (line 184)

Result sub-mappings using the discriminiator column.

- return: result sub-map.
- access: public

TResultMap resolveSubMap (TSqlMapTypeHandlerRegistry $registry, array $row)

- TSqlMapTypeHandlerRegistry $registry: type handler registry
- array $row: row data.

setClass (line 84)

- access: public

void setClass (string $value)

- string $value: result class name.

setDiscriminator (line 140)

- access: public

void setDiscriminator (TDiscriminator $value)

- TDiscriminator $value: result class discriminator.

setExtends (line 108)

- access: public

void setExtends (string $value)

- string $value: result map extends another result map.

setGroupBy (line 124)

- access: public

void setGroupBy (string $value)

- string $value: result map group by

setID (line 68)

- access: public

void setID (string $value)

- string $value: a unique identifier for the <resultMap>.

#### Inherited 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()

Documentation generated on Mon, 21 Apr 2008 11:36:04 -0400 by phpDocumentor 1.3.0RC4