Class TResultProperty

Description

TResultProperty corresponds a <property> tags inside a <resultMap> tag.

The NullValue attribute can be set to any valid value (based on property type). The NullValue attribute is used to specify an outgoing null value replacement. What this means is that when a null value is detected in the result, the corresponding value of the NullValue will be used instead.

The Select property is used to describe a relationship between objects and to automatically load complex (i.e. user defined) property types. The value of the Select property must be the name of another mapped statement. The value of the database Column that is defined in the same property element as this statement attribute will be passed to the related mapped statement as the parameter. The LazyLoad attribute can be specified with the Select .

  • since: 3.1
  • version: $Id: TResultProperty.php 1566 2006-12-05 23:37:07Z wei $
  • author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/SqlMap/Configuration/TResultProperty.php (line 36)

TComponent
   |
   --TResultProperty
Class Constant Summary
Method Summary
TResultProperty __construct ([TResultMap $resultMap = null])
string getColumn ()
boolean getLazyLoad ()
mixed getNullValue ()
string getProperty ()
mixed getPropertyValue (TSqlMapTypeHandlerRegistry $registry, array $row)
string getResultMapping ()
string getSelect ()
string getType ()
mixed getTypedValue (TSqlMapTypeHandlerRegistry $registry, mixed $value)
string getTypeHandler ()
boolean instanceOfArrayType (object result $target)
boolean instanceOfListType (object result $target)
void setColumn (string $value)
void setColumnIndex (int $value)
void setLazyLoad (boolean $value)
void setNestedResultMap (TResult $value)
void setNullValue (mixed $value)
void setProperty (string $value)
void setResultMapping (mixed $value)
void setSelect (string $value)
void setType (string $value)
void setTypeHandler (string $value)
Methods
Constructor __construct (line 58)

Gets the containing result map ID.

  • access: public
TResultProperty __construct ([TResultMap $resultMap = null])
createTypeHandler (line 268)

Create type handler from Type or TypeHandler.

  • return: type handler.
  • access: protected
TSqlMapTypeHandler createTypeHandler (TSqlMapTypeHandlerRegistry $registry)
getColumn (line 100)
  • return: 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 118)
  • return: index of the column in the ResultSet from which the value will be used to populate the object property
  • access: public
int getColumnIndex ()
getLazyLoad (line 217)
  • return: indicate whether or not the select statement's results should be lazy loaded
  • access: public
boolean getLazyLoad ()
getNestedResultMap (line 151)
  • return: nested result map.
  • access: public
TResultMap getNestedResultMap ()
getNullValue (line 67)
  • return: null value replacement.
  • access: public
mixed getNullValue ()
getProperty (line 83)
  • return: name of a property of the result object that will be set to.
  • access: public
string getProperty ()
getPropertyValue (line 236)

Gets the value for the current property, converts to applicable type if necessary.

  • return: property value.
  • access: public
mixed getPropertyValue (TSqlMapTypeHandlerRegistry $registry, array $row)
getPropertyValueType (line 281)

Determines if the type is an instance of ArrayAccess, TList or an array.

  • return: TResultProperty::LIST_TYPE or TResultProperty::ARRAY_TYPE
  • access: protected
int getPropertyValueType ()
getResultMapping (line 135)
  • return: ID of another <resultMap> used to fill the property.
  • access: public
string getResultMapping ()
getSelect (line 199)
  • return: name of another mapped statement
  • access: public
string getSelect ()
getType (line 167)
  • return: property type of the object property to be set.
  • access: public
string getType ()
getTypedValue (line 255)
  • return: property value casted to specific type.
  • access: protected
mixed getTypedValue (TSqlMapTypeHandlerRegistry $registry, mixed $value)
getTypeHandler (line 183)
  • return: custom type handler class name (may use namespace).
  • access: public
string getTypeHandler ()
instanceOfArrayType (line 316)

Returns true if the result property Type is of ArrayAccess

or that the actual result object is an array or implements ArrayAccess

  • return: true if the result object is an instance of ArrayAccess or is an array.
  • access: public
boolean instanceOfArrayType (object result $target)
  • object result $target: object
instanceOfListType (line 303)

Returns true if the result property Type is of TList type or that the actual result object is an instance of TList.

  • return: true if the result object is an instance of TList
  • access: public
boolean instanceOfListType (object result $target)
  • object result $target: object
setColumn (line 109)
  • access: public
void setColumn (string $value)
  • string $value: name of the column in the result set from which the value will be used to populate the property.
setColumnIndex (line 127)
  • access: public
void setColumnIndex (int $value)
  • int $value: index of the column in the ResultSet from which the value will be used to populate the object property
setLazyLoad (line 225)
  • access: public
void setLazyLoad (boolean $value)
  • boolean $value: indicate whether or not the select statement's results should be lazy loaded
setNestedResultMap (line 159)
  • access: public
void setNestedResultMap (TResult $value)
  • TResult $value: nested result map.
setNullValue (line 75)
  • access: public
void setNullValue (mixed $value)
  • mixed $value: null value replacement.
setProperty (line 91)
  • access: public
void setProperty (string $value)
  • string $value: name of a property of the result object that will be set to.
setResultMapping (line 143)
  • access: public
void setResultMapping (mixed $value)
setSelect (line 209)

The select property is used to describe a relationship between objects and to automatically load complex (i.e. user defined) property types.

  • access: public
void setSelect (string $value)
  • string $value: name of another mapped statement.
setType (line 175)
  • access: public
void setType (string $value)
  • string $value: property type of the object property to be set.
setTypeHandler (line 191)
  • 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()
Class Constants
ARRAY_TYPE = 1 (line 52)
LIST_TYPE = 0 (line 51)

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