diff options
Diffstat (limited to 'framework/Data/SqlMap')
-rw-r--r-- | framework/Data/SqlMap/Configuration/TParameterMap.php | 19 | ||||
-rw-r--r-- | framework/Data/SqlMap/TSqlMapManager.php | 16 |
2 files changed, 18 insertions, 17 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.
diff --git a/framework/Data/SqlMap/TSqlMapManager.php b/framework/Data/SqlMap/TSqlMapManager.php index 37d50f5d..fa45b849 100644 --- a/framework/Data/SqlMap/TSqlMapManager.php +++ b/framework/Data/SqlMap/TSqlMapManager.php @@ -93,22 +93,6 @@ class TSqlMapManager extends TComponent }
/**
- * @param string configuration file.
- */
- public function setConfigFile($file)
- {
- $this->_configFile=$file;
- }
-
- /**
- * @return string configuration file.
- */
- public function getConfigFile()
- {
- return $this->_configFile;
- }
-
- /**
* @return TSqlMapGateway SqlMap gateway.
*/
public function getSqlmapGateway()
|