BooleanType
class BooleanType extends Type (View source)
Type that maps an SQL boolean to a PHP boolean.
Constants
TARRAY |
|
SIMPLE_ARRAY |
|
JSON_ARRAY |
|
BIGINT |
|
BOOLEAN |
|
DATETIME |
|
DATETIMETZ |
|
DATE |
|
TIME |
|
DECIMAL |
|
INTEGER |
|
OBJECT |
|
SMALLINT |
|
STRING |
|
TEXT |
|
BLOB |
|
FLOAT |
|
GUID |
|
Methods
Converts a value from its PHP representation to its database representation of this type.
Converts a value from its database representation to its PHP representation of this type.
Gets the SQL declaration snippet for a field of this type.
Gets the name of this type.
Overrides an already defined type to use a different implementation.
Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements.
Get the types array map which holds all registered types and the corresponding type class
Does working with this column require SQL conversion functions?
Modifies the SQL expression (identifier, parameter) to convert to a database value.
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
Get an array of database types that map to this Doctrine type.
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.
Details
at line 38
mixed
convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
Converts a value from its PHP representation to its database representation of this type.
at line 43
mixed
convertToPHPValue(mixed $value, AbstractPlatform $platform)
Converts a value from its database representation to its PHP representation of this type.
getDefaultLength(AbstractPlatform $platform)
Gets the default length of this type.
at line 33
getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
Gets the SQL declaration snippet for a field of this type.
at line 48
string
getName()
Gets the name of this type.
static Type
getType(string $name)
Factory method to create type instances.
Type instances are implemented as flyweights.
static
addType(string $name, string $className)
Adds a custom type to the type map.
static
overrideType(string $name, string $className)
Overrides an already defined type to use a different implementation.
at line 53
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
static array
getTypesMap()
Get the types array map which holds all registered types and the corresponding type class
bool
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.
string
convertToDatabaseValueSQL(string $sqlExpr, AbstractPlatform $platform)
Modifies the SQL expression (identifier, parameter) to convert to a database value.
string
convertToPHPValueSQL(string $sqlExpr, AbstractPlatform $platform)
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
array
getMappedDatabaseTypes(AbstractPlatform $platform)
Get an array of database types that map to this Doctrine type.
bool
requiresSQLCommentHint(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.