Static Public Member Functions | |
static | getType ($nativeType) |
This method returns the generic Creole (JDBC-like) type when given the native db type. | |
static | getNativeType ($creoleType) |
This method will return a native type that corresponds to the specified Creole (JDBC-like) type. | |
Static Private Attributes | |
static | $typeMap |
static | $reverseMap = null |
Reverse mapping, created on demand. |
Definition at line 32 of file SQLiteTypes.php.
static SQLiteTypes::getNativeType | ( | $ | creoleType | ) | [static] |
This method will return a native type that corresponds to the specified Creole (JDBC-like) type.
Remember that this is really only for "hint" purposes as SQLite is typeless.
If there is more than one matching native type, then the LAST defined native type will be returned.
int | $creoleType |
Reimplemented from CreoleTypes.
Definition at line 100 of file SQLiteTypes.php.
00101 { 00102 if (self::$reverseMap === null) { 00103 self::$reverseMap = array_flip(self::$typeMap); 00104 } 00105 return @self::$reverseMap[$creoleType]; 00106 }
static SQLiteTypes::getType | ( | $ | nativeType | ) | [static] |
This method returns the generic Creole (JDBC-like) type when given the native db type.
If no match is found then we just return CreoleTypes::TEXT because SQLite is typeless.
string | $nativeType DB native type (e.g. 'TEXT', 'byetea', etc.). |
Reimplemented from CreoleTypes.
Definition at line 79 of file SQLiteTypes.php.
References CreoleTypes::TEXT.
Referenced by SQLiteTableInfo::initColumns().
00080 { 00081 $t = strtolower($nativeType); 00082 if (isset(self::$typeMap[$t])) { 00083 return self::$typeMap[$t]; 00084 } else { 00085 return CreoleTypes::TEXT; // because SQLite is typeless 00086 } 00087 }
SQLiteTypes::$reverseMap = null [static, private] |
SQLiteTypes::$typeMap [static, private] |
Initial value:
array( 'tinyint' => CreoleTypes::TINYINT, 'smallint' => CreoleTypes::SMALLINT, 'mediumint' => CreoleTypes::SMALLINT, 'int' => CreoleTypes::INTEGER, 'integer' => CreoleTypes::INTEGER, 'bigint' => CreoleTypes::BIGINT, 'int24' => CreoleTypes::BIGINT, 'real' => CreoleTypes::REAL, 'float' => CreoleTypes::FLOAT, 'decimal' => CreoleTypes::DECIMAL, 'numeric' => CreoleTypes::NUMERIC, 'double' => CreoleTypes::DOUBLE, 'char' => CreoleTypes::CHAR, 'varchar' => CreoleTypes::VARCHAR, 'date' => CreoleTypes::DATE, 'time' => CreoleTypes::TIME, 'year' => CreoleTypes::YEAR, 'datetime' => CreoleTypes::TIMESTAMP, 'timestamp' => CreoleTypes::TIMESTAMP, 'tinyblob' => CreoleTypes::BINARY, 'blob' => CreoleTypes::VARBINARY, 'mediumblob' => CreoleTypes::VARBINARY, 'longblob' => CreoleTypes::VARBINARY, 'tinytext' => CreoleTypes::VARCHAR, 'mediumtext' => CreoleTypes::LONGVARCHAR, 'text' => CreoleTypes::LONGVARCHAR, )
Definition at line 40 of file SQLiteTypes.php.