The base class for so-called Doctrine mapping types. A Type object is obtained by calling the static {@link getType()} method.

Known subclasses


Open source code
Methods Summary
# convertToDatabaseValue( mixed $value , Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Converts a value from its PHP representation to its database representation of this type.
# convertToPHPValue( mixed $value , Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Converts a value from its database representation to its PHP representation of this type.
# getDefaultLength( Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Gets the default length of this type.


abstract public
# getSQLDeclaration( array $fieldDeclaration , Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Gets the SQL declaration snippet for a field of this type.
abstract public
# getName( )
Gets the name of this type.


public static
# getType( string $name )
Factory method to create type instances. Type instances are implemented as flyweights.
public static
# addType( string $name , string $className )
Adds a custom type to the type map.
public static
# hasType( string $name )
Checks if exists support for a type.
public static
# overrideType( string $name , string $className )
Overrides an already defined type to use a different implementation.
# getBindingType( )
Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements. This method should return one of the PDO::PARAM_* constants, that is, one of: PDO::PARAM_BOOL PDO::PARAM_NULL PDO::PARAM_INT PDO::PARAM_STR PDO::PARAM_LOB
public static
# getTypesMap( )
Gets the types array map which holds all registered types and the corresponding type class
# canRequireSQLConversion( )
Does working with this column require SQL conversion functions? This is a metadata function that is required for example in the ORM. Usage of {@link convertToDatabaseValueSQL} and {@link convertToPHPValueSQL} works for any type and mostly does nothing. This method can additionally be used for optimization purposes.
# convertToDatabaseValueSQL( string $sqlExpr , Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Modifies the SQL expression (identifier, parameter) to convert to a database value.
# convertToPHPValueSQL( string $sqlExpr , \Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
# getMappedDatabaseTypes( Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Gets an array of database types that map to this Doctrine type.
# requiresSQLCommentHint( Doctrine\DBAL\Platforms\AbstractPlatform $platform )
If this Doctrine Type maps to an already mapped database type, reverse schema engineering can't take them apart. You need to mark one of those types as commented, which will have Doctrine use an SQL comment to typehint the actual Doctrine Type.
Constants Summary
public string TARRAY
# 'array'
public string SIMPLE_ARRAY
# 'simple_array'
public string JSON_ARRAY
# 'json_array'
public string JSON
# 'json'
public string BIGINT
# 'bigint'
public string BOOLEAN
# 'boolean'
public string DATETIME
# 'datetime'
# 'datetime_immutable'
public string DATETIMETZ
# 'datetimetz'
# 'datetimetz_immutable'
public string DATE
# 'date'
public string DATE_IMMUTABLE
# 'date_immutable'
public string TIME
# 'time'
public string TIME_IMMUTABLE
# 'time_immutable'
public string DECIMAL
# 'decimal'
public string INTEGER
# 'integer'
public string OBJECT
# 'object'
public string SMALLINT
# 'smallint'
public string STRING
# 'string'
public string TEXT
# 'text'
public string BINARY
# 'binary'
public string BLOB
# 'blob'
public string FLOAT
# 'float'
public string GUID
# 'guid'
public string DATEINTERVAL
# 'dateinterval'