summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Configuration
diff options
context:
space:
mode:
authorwei <>2006-12-20 03:15:04 +0000
committerwei <>2006-12-20 03:15:04 +0000
commit2c221ea67d0512961beea8fbcb30b23865c16bb0 (patch)
treeaba7901f8e286d0b4101fc9022247897881bd5c1 /framework/Data/SqlMap/Configuration
parent2570226fbac3e26b1e94896b50d1db4bc1aa3308 (diff)
Add quickstart docs for Active Record and SqlMap
Diffstat (limited to 'framework/Data/SqlMap/Configuration')
-rw-r--r--framework/Data/SqlMap/Configuration/TParameterMap.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/framework/Data/SqlMap/Configuration/TParameterMap.php b/framework/Data/SqlMap/Configuration/TParameterMap.php
index e4d77a91..74fe8800 100644
--- a/framework/Data/SqlMap/Configuration/TParameterMap.php
+++ b/framework/Data/SqlMap/Configuration/TParameterMap.php
@@ -140,7 +140,7 @@ class TParameterMap extends TComponent
{
$value = $this->getObjectValue($parameterValue,$property);
- if(!is_null($handler=$registry->getTypeHandler($property->getType())))
+ if(!is_null($handler=$this->createTypeHandler($property, $registry)))
$value = $handler->getParameter($value);
$value = $this->nullifyDefaultValue($property,$value);
@@ -150,6 +150,23 @@ class TParameterMap extends TComponent
return $value;
}
+
+
+ /**
+ * Create type handler from {@link Type setType()} or {@link TypeHandler setTypeHandler}.
+ * @param TParameterProperty parameter property
+ * @param TSqlMapTypeHandlerRegistry type handler registry
+ * @return TSqlMapTypeHandler type handler.
+ */
+ protected function createTypeHandler($property, $registry)
+ {
+ $type=$property->getTypeHandler() ? $property->getTypeHandler() : $property->getType();
+ $handler=$registry->getTypeHandler($type);
+ if($handler===null && $property->getTypeHandler())
+ $handler = Prado::createComponent($type);
+ return $handler;
+ }
+
/**
* @param mixed object to obtain the property from.