Type
public abstract class Type
Field Summary | |
---|---|
final str | |
final str | |
final str | |
final str | |
final str | |
final str | |
final str | |
final str | |
final str | |
final str | |
final str | |
final str |
Constructor Summary | |
---|---|
Type() |
Method Summary | |
---|---|
static void | addType(string name, string className) Adds a custom type to the type map. |
mixed | convertToDatabaseValue(mixed value, AbstractPlatform platform) Converts a value from its PHP representation to its database representation of this type. |
mixed | convertToPHPValue(mixed value, AbstractPlatform platform) Converts a value from its database representation to its PHP representation of this type. |
integer | Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements. |
void | getDefaultLength(mixed platform) Gets the default length of this type. |
abstract string | getName() Gets the name of this type. |
abstract void | getSqlDeclaration(array fieldDeclaration, AbstractPlatform platform) Gets the SQL declaration snippet for a field of this type. |
static Doctrine\DBAL\Types\Type | getType(string name) Factory method to create type instances. |
static array | Get the types array map which holds all registered types and the corresponding type class |
static boolean | hasType(string name) Checks if exists support for a type. |
static void | overrideType(string name, string className) Overrides an already defined type to use a different implementation. |
public final str BIGINT = 'bigint'
public final str BOOLEAN = 'boolean'
public final str DATE = 'date'
public final str DATETIME = 'datetime'
public final str DECIMAL = 'decimal'
public final str INTEGER = 'integer'
public final str OBJECT = 'object'
public final str SMALLINT = 'smallint'
public final str STRING = 'string'
public final str TARRAY = 'array'
public final str TEXT = 'text'
public final str TIME = 'time'
public Type()
public static void addType(string name, string className)
Adds a custom type to the type map.
public mixed convertToDatabaseValue(mixed value, AbstractPlatform platform)
Converts a value from its PHP representation to its database representation of this type.
public mixed convertToPHPValue(mixed value, AbstractPlatform platform)
Converts a value from its database representation to its PHP representation of this type.
public integer 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 void getDefaultLength(mixed platform)
Gets the default length of this type.
public abstract string getName()
Gets the name of this type.
public abstract void getSqlDeclaration(array fieldDeclaration, AbstractPlatform platform)
Gets the SQL declaration snippet for a field of this type.
public static Doctrine\DBAL\Types\Type getType(string name)
Factory method to create type instances. Type instances are implemented as flyweights.
public static array getTypesMap()
Get the types array map which holds all registered types and the corresponding type class
public static boolean hasType(string name)
Checks if exists support for a type.
public static void overrideType(string name, string className)
Overrides an already defined type to use a different implementation.
The base class for so-called Doctrine mapping types.
A Type object is obtained by calling the static
getType()
method.