diff options
Diffstat (limited to 'framework/Data/ActiveRecord/Vendor/TMysqlColumnMetaData.php')
-rw-r--r-- | framework/Data/ActiveRecord/Vendor/TMysqlColumnMetaData.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/Data/ActiveRecord/Vendor/TMysqlColumnMetaData.php b/framework/Data/ActiveRecord/Vendor/TMysqlColumnMetaData.php index b5bd4050..e7e7ceb8 100644 --- a/framework/Data/ActiveRecord/Vendor/TMysqlColumnMetaData.php +++ b/framework/Data/ActiveRecord/Vendor/TMysqlColumnMetaData.php @@ -56,6 +56,21 @@ class TMysqlColumnMetaData extends TComponent return $this->_name;
}
+ public function getPHPType()
+ {
+ switch(strtolower($this->_type))
+ {
+ case 'tinyint': case 'smallint': case 'mediumint': case 'int': case 'year':
+ return 'integer';
+ case 'bool':
+ return 'boolean';
+ case 'bigint': case 'float': case 'double': case 'decimal':
+ return 'float';
+ default:
+ return 'string';
+ }
+ }
+
/**
* @return boolean true if column is a sequence, false otherwise.
*/
|