From 3dc598bc7c2604e24b9e0be1189d9d78b43737ea Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 17 Jan 2007 08:01:40 +0000 Subject: Add active record generator. --- .../Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php') diff --git a/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php b/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php index d6ea8ca7..59a2d43e 100644 --- a/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php +++ b/framework/Data/ActiveRecord/Vendor/TPgsqlColumnMetaData.php @@ -57,6 +57,21 @@ class TPgsqlColumnMetaData extends TComponent return $this->_name; } + public function getPHPType() + { + switch(strtolower($this->_type)) + { + case 'bit': case 'bit varying': case 'real': case 'serial': + return 'integer'; + case 'boolean': + return 'boolean'; + case 'bigint': case 'bigserial': case 'double precision': case 'money': case 'numeric': + return 'float'; + default: + return 'string'; + } + } + /** * @return boolean true if column is a sequence, false otherwise. */ -- cgit v1.2.3