| Methods |
public
|
convertToDatabaseValue(mixed $value, AbstractPlatform $platform): mixed
Converts a value from its PHP representation to its database representation
of this type.
Converts a value from its PHP representation to its database representation
of this type.
Parameters
| $value |
The value to convert.
|
| $platform |
The currently used database platform.
|
Returns
The database representation of the value.
Throws
Overriden by
|
#
|
public
|
convertToPHPValue(mixed $value, AbstractPlatform $platform): mixed
Converts a value from its database representation to its PHP representation
of this type.
Converts a value from its database representation to its PHP representation
of this type.
Parameters
| $value |
The value to convert.
|
| $platform |
The currently used database platform.
|
Returns
The PHP representation of the value.
Throws
Overriden by
|
#
|
abstract
public
|
getSQLDeclaration(mixed[] $column, AbstractPlatform $platform): string
Gets the SQL declaration snippet for a column of this type.
Gets the SQL declaration snippet for a column of this type.
Parameters
| $column |
The column definition
|
| $platform |
The currently used database platform.
|
Implemented by
|
#
|
abstract
public
|
getName(): string
Gets the name of this type.
Gets the name of this type.
Deprecated
this method will be removed in Doctrine DBAL 4.0,
use {@see TypeRegistry::lookupName()} instead.
Implemented by
|
#
|
final
public
static
|
getTypeRegistry(): TypeRegistry
|
#
|
private
static
|
createTypeRegistry(): TypeRegistry
|
#
|
public
static
|
getType(string $name): Type
Factory method to create type instances.
Type instances are implemented as flyweights.
Factory method to create type instances.
Type instances are implemented as flyweights.
Parameters
| $name |
The name of the type (as returned by getName()).
|
Throws
|
#
|
public
static
|
lookupName(self $type): string
Finds a name for the given type.
Finds a name for the given type.
Throws
|
#
|
public
static
|
addType(string $name, class-string<Type> $className): void
Adds a custom type to the type map.
Adds a custom type to the type map.
Parameters
| $name |
The name of the type. This should correspond to what getName() returns.
|
| $className |
The class name of the custom type.
|
Throws
|
#
|
public
static
|
hasType(string $name): bool
Checks if exists support for a type.
Checks if exists support for a type.
Parameters
| $name |
The name of the type.
|
Returns
TRUE if type is supported; FALSE otherwise.
|
#
|
public
static
|
overrideType(string $name, class-string<Type> $className): void
Overrides an already defined type to use a different implementation.
Overrides an already defined type to use a different implementation.
Throws
|
#
|
public
|
getBindingType(): int
Gets the (preferred) binding type for values of this type that
can be used when binding parameters to prepared…
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 {@see ParameterType} constants.
Overriden by
|
#
|
public
static
|
getTypesMap(): array<string, string>
Gets the types array map which holds all registered types and the corresponding
type class
Gets the types array map which holds all registered types and the corresponding
type class
|
#
|
public
|
canRequireSQLConversion(): bool
Does working with this column require SQL conversion functions?
Does working with this column require SQL conversion functions?
This is a metadata function that is required for example in the ORM.
Usage of {@see convertToDatabaseValueSQL} and
{@see convertToPHPValueSQL} works for any type and mostly
does nothing. This method can additionally be used for optimization purposes.
Deprecated
Consumers should call {@see convertToDatabaseValueSQL} and {@see convertToPHPValueSQL}
regardless of the type.
|
#
|
public
|
convertToDatabaseValueSQL(string $sqlExpr, AbstractPlatform $platform): string
Modifies the SQL expression (identifier, parameter) to convert to a database value.
Modifies the SQL expression (identifier, parameter) to convert to a database value.
|
#
|
public
|
convertToPHPValueSQL(string $sqlExpr, AbstractPlatform $platform): string
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
|
#
|
public
|
getMappedDatabaseTypes(AbstractPlatform $platform): string[]
Gets an array of database types that map to this Doctrine type.
Gets an array of database types that map to this Doctrine type.
|
#
|
public
|
requiresSQLCommentHint(AbstractPlatform $platform): bool
If this Doctrine Type maps to an already mapped database type,
reverse schema engineering can't tell them apart. You…
If this Doctrine Type maps to an already mapped database type,
reverse schema engineering can't tell 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.
Overriden by
|
#
|