diff options
author | wei <> | 2006-12-20 03:15:04 +0000 |
---|---|---|
committer | wei <> | 2006-12-20 03:15:04 +0000 |
commit | 2c221ea67d0512961beea8fbcb30b23865c16bb0 (patch) | |
tree | aba7901f8e286d0b4101fc9022247897881bd5c1 /framework | |
parent | 2570226fbac3e26b1e94896b50d1db4bc1aa3308 (diff) |
Add quickstart docs for Active Record and SqlMap
Diffstat (limited to 'framework')
-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()
|