diff options
author | wei <> | 2007-03-31 06:42:15 +0000 |
---|---|---|
committer | wei <> | 2007-03-31 06:42:15 +0000 |
commit | 54c90d0102515ad58a882a6b3f4ac623fc9d50ed (patch) | |
tree | f111d06ef5ab1771a723e9a4f807f39039ec3fae /framework/Data/ActiveRecord/Scaffold/InputBuilder | |
parent | e54507780bbb25537735139fdf65637fbaa39542 (diff) |
Add changes by ezar for IBM Db2 Active Record support.
Diffstat (limited to 'framework/Data/ActiveRecord/Scaffold/InputBuilder')
-rw-r--r-- | framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php | 51 | ||||
-rw-r--r-- | framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php | 3 |
2 files changed, 54 insertions, 0 deletions
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php new file mode 100644 index 00000000..ada2091e --- /dev/null +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php @@ -0,0 +1,51 @@ +<?php
+/**
+ * TIbmScaffoldInput class file.
+ *
+ * @author Cesar Ramos <cramos[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005-2007 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
+Prado::using('System.Data.ActiveRecord.Scaffold.InputBuilder.TScaffoldInputCommon');
+
+class TIbmScaffoldInput extends TScaffoldInputCommon
+{
+ protected function createControl($container, $column, $record)
+ {
+ switch(strtolower($column->getType()))
+ {
+ case 'date':
+ return $this->createDateControl($container, $column, $record);
+ case 'time':
+ return $this->createTimeControl($container, $column, $record);
+ case 'timestamp':
+ return $this->createDateTimeControl($container, $column, $record);
+ case 'smallint': case 'integer': case 'bigint':
+ return $this->createIntegerControl($container, $column, $record);
+ case 'decimal': case 'numeric': case 'real': case 'float': case 'double':
+ return $this->createFloatControl($container, $column, $record);
+ case 'char': case 'varchar':
+ return $this->createMultiLineControl($container, $column, $record);
+ default:
+ return $this->createDefaultControl($container,$column, $record);
+ }
+ }
+
+ protected function getControlValue($container, $column, $record)
+ {
+ switch(strtolower($column->getType()))
+ {
+ case 'date':
+ return $container->findControl(self::DEFAULT_ID)->getDate();
+ case 'time':
+ return $this->getTimeValue($container, $column, $record);
+ case 'timestamp':
+ return $this->getDateTimeValue($container, $column, $record);
+ default:
+ return $this->getDefaultControlValue($container,$column, $record);
+ }
+ }
+}
+
+?>
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php index c06f2fb6..05e83157 100644 --- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php +++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php @@ -27,6 +27,9 @@ class TScaffoldInputBase case 'pgsql':
require_once(dirname(__FILE__).'/TPgsqlScaffoldInput.php');
return new TPgsqlScaffoldInput($conn);
+ case 'ibm':
+ require_once(dirname(__FILE__).'/TIbmScaffoldInput.php');
+ return new TIbmScaffoldInput($conn);
default:
throw new TConfigurationException(
'scaffold_invalid_database_driver',$driver);
|