1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

- removed 'FIELD_' from dibi data types

This commit is contained in:
David Grudl
2009-03-16 06:48:27 +00:00
parent a9afe1e397
commit 5946b7e1f6
16 changed files with 121 additions and 112 deletions

View File

@@ -476,17 +476,17 @@ class DibiColumnInfo extends DibiObject
public static function detectType($type)
{
static $patterns = array(
'BYTE|COUNTER|SERIAL|INT|LONG' => dibi::FIELD_INTEGER,
'CURRENCY|REAL|MONEY|FLOAT|DOUBLE|DECIMAL|NUMERIC|NUMBER' => dibi::FIELD_FLOAT,
'^TIME$' => dibi::FIELD_TIME,
'TIME' => dibi::FIELD_DATETIME, // DATETIME, TIMESTAMP
'YEAR|DATE' => dibi::FIELD_DATE,
'BYTEA|BLOB|BIN' => dibi::FIELD_BINARY,
'BOOL|BIT' => dibi::FIELD_BOOL,
'BYTE|COUNTER|SERIAL|INT|LONG' => dibi::INTEGER,
'CURRENCY|REAL|MONEY|FLOAT|DOUBLE|DECIMAL|NUMERIC|NUMBER' => dibi::FLOAT,
'^TIME$' => dibi::TIME,
'TIME' => dibi::DATETIME, // DATETIME, TIMESTAMP
'YEAR|DATE' => dibi::DATE,
'BYTEA|BLOB|BIN' => dibi::BINARY,
'BOOL|BIT' => dibi::BOOL,
);
if (!isset(self::$types[$type])) {
self::$types[$type] = dibi::FIELD_TEXT;
self::$types[$type] = dibi::TEXT;
foreach ($patterns as $s => $val) {
if (preg_match("#$s#i", $type)) {
return self::$types[$type] = $val;