MySQLTypes Class Reference

Inheritance diagram for MySQLTypes:

CreoleTypes

List of all members.

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
 Map MySQL native types to Creole (JDBC) types.
static $reverseMap = null
 Reverse mapping, created on demand.


Detailed Description

Definition at line 32 of file MySQLTypes.php.


Member Function Documentation

static MySQLTypes::getNativeType ( creoleType  )  [static]

This method will return a native type that corresponds to the specified Creole (JDBC-like) type.

If there is more than one matching native type, then the LAST defined native type will be returned.

Parameters:
int $creoleType
Returns:
string Native type string.

Reimplemented from CreoleTypes.

Definition at line 94 of file MySQLTypes.php.

00095     {
00096         if (self::$reverseMap === null) {
00097             self::$reverseMap = array_flip(self::$typeMap);
00098         }
00099         return @self::$reverseMap[$creoleType];
00100     }

static MySQLTypes::getType ( nativeType  )  [static]

This method returns the generic Creole (JDBC-like) type when given the native db type.

Parameters:
string $nativeType DB native type (e.g. 'TEXT', 'byetea', etc.).
Returns:
int Creole native type (e.g. CreoleTypes::LONGVARCHAR, CreoleTypes::BINARY, etc.).

Reimplemented from CreoleTypes.

Definition at line 76 of file MySQLTypes.php.

References CreoleTypes::OTHER.

Referenced by MySQLiTableInfo::initColumns(), and MySQLTableInfo::initColumns().

00077     {
00078         $t = strtolower($nativeType);
00079         if (isset(self::$typeMap[$t])) {
00080             return self::$typeMap[$t];
00081         } else {
00082             return CreoleTypes::OTHER;
00083         }
00084     }


Member Data Documentation

MySQLTypes::$reverseMap = null [static, private]

Reverse mapping, created on demand.

Definition at line 68 of file MySQLTypes.php.

MySQLTypes::$typeMap [static, private]

Map MySQL native types to Creole (JDBC) types.

Definition at line 35 of file MySQLTypes.php.


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:10:50 2009 for fareofficelib by  doxygen 1.5.8