summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php
diff options
context:
space:
mode:
authorwei <>2007-02-12 12:46:11 +0000
committerwei <>2007-02-12 12:46:11 +0000
commitfd4b8d9f45d1707035021bc19b8d5bc17ede66ce (patch)
tree093b8b3f92d4d6421f19a6d1e7c8211817f3d51d /framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php
parentf4c525abc3d4d3f3eecf1019770936e4ca39fd62 (diff)
Add IBM DB2 driver for active record.
Diffstat (limited to 'framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php')
-rw-r--r--framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php b/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php
index a51c435d..2774bb54 100644
--- a/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php
+++ b/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php
@@ -44,13 +44,30 @@ class TPgsqlColumnMetaData extends TComponent
{
$this->_property=$property;
$this->_name=$name;
- $this->_type=$type;
$this->_length=$length;
+ $this->processType($type);
$this->_notNull=$notNull;
$this->_sequenceName=$serial;
$this->_default=$default;
}
+ protected function processType($type)
+ {
+ if(is_int($pos=strpos($type, '(')))
+ {
+ $match=array();
+ if(preg_match('/\((.*)\)/', $type, $match))
+ {
+ $this->_length=floatval($match[1]);
+ $this->_type = substr($type,0,$pos);
+ }
+ else
+ $this->_type = $type;
+ }
+ else
+ $this->_type = $type;
+ }
+
/**
* @return string quoted column name.
*/