## Class TDiscriminator

Description

The TDiscriminator corresponds to the <discriminator> tag within a <resultMap>.

TDiscriminator allows inheritance logic in SqlMap result mappings. SqlMap compares the data found in the discriminator column to the different <submap> values using the column value's string equivalence. When the string values matches a particular <submap>, SqlMap will use the <resultMap> defined by resultMapping property for loading the object data.

- since: 3.1
- version: $Id: TDiscriminator.php 1555 2006-12-04 00:02:23Z wei $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/SqlMap/Configuration/TDiscriminator.php (line 28)

    TComponent
       |
       --TDiscriminator

Method Summary
void addSubMap (TSubMap $subMap)
string getColumn ()
int getColumnIndex ()
TResultProperty getMapping ()
mixed getNullValue ()
TResultMap getSubMap (string $value)
void getType (string 0)
string getTypeHandler ()
void initialize (TSqlMapManager $manager)
void initMapping (TResultMap $resultMap)
void setColumn (string $value)
void setColumnIndex (int $value)
void setNullValue (mixed $value)
string setType (mixed $value)
void setTypeHandler (string $value)
Methods
addSubMap (line 138)

- access: public

void addSubMap (TSubMap $subMap)

- TSubMap $subMap: add new sub mapping.

getColumn (line 43)

- return: the name of the column in the result set from which the value will be used to populate the property.
- access: public

string getColumn ()
getColumnIndex (line 96)

- return: index of the column in the ResultSet
- access: public

int getColumnIndex ()
getMapping (line 130)

- return: result property for the discriminator column.
- access: public

TResultProperty getMapping ()
getNullValue (line 114)

- return: outgoing null value replacement.
- access: public

mixed getNullValue ()
getSubMap (line 147)

- return: result mapping.
- access: public

TResultMap getSubMap (string $value)

- string $value: database value

getType (line 60)

- access: public

void getType (string 0)

- string 0: property type of the parameter to be set.

getTypeHandler (line 80)

- return: custom type handler class name (may use namespace).
- access: public

string getTypeHandler ()
initialize (line 171)

Set the result maps for particular sub-mapping values.

- access: public

void initialize (TSqlMapManager $manager)

- TSqlMapManager $manager: sql map manager instance.

initMapping (line 157)

Copies the discriminator properties to a new TResultProperty.

- access: public

void initMapping (TResultMap $resultMap)

- TResultMap $resultMap: result map holding the discriminator.

setColumn (line 52)

- access: public

void setColumn (string $value)

- string $value: the name of the column in the result set from which the value will be used to populate the property.

setColumnIndex (line 106)

The columnIndex attribute value is the index of the column in the ResultSet from which the value will be used to populate the object property.

- access: public

void setColumnIndex (int $value)

- int $value: index of the column in the ResultSet

setNullValue (line 122)

- access: public

void setNullValue (mixed $value)

- mixed $value: outgoing null value replacement.

setType (line 72)

The type attribute is used to explicitly specify the property type of the parameter to be set. If the attribute type is not set and the framework cannot otherwise determine the type, the type is assumed from the default value of the property.

- return: property type of the parameter to be set.
- access: public

string setType (mixed $value)
setTypeHandler (line 88)

- access: public

void setTypeHandler (string $value)

- string $value: custom type handler class name (may use namespace).

#### 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:34:56 -0400 by phpDocumentor 1.3.0RC4