Type

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

Known subclasses

Omeka\Db\Type\IpAddress
Abstract



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

todo


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.

todo


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.
public
# 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
public
public
# 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.
public
# convertToDatabaseValueSQL( string $sqlExpr , Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Modifies the SQL expression (identifier, parameter) to convert to a database value.
public
# convertToPHPValueSQL( string $sqlExpr , \Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
public
# getMappedDatabaseTypes( Doctrine\DBAL\Platforms\AbstractPlatform $platform )
Gets an array of database types that map to this Doctrine type.
public
# 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'
public string DATETIME_IMMUTABLE
# 'datetime_immutable'
public string DATETIMETZ
# 'datetimetz'
public string DATETIMETZ_IMMUTABLE
# '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'