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.
|
#
|
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.
|
#
|
public
|
getDefaultLength(AbstractPlatform $platform): int|null
Gets the default length of this type.
Gets the default length of this type.
Deprecated
Rely on information provided by the platform instead.
|
#
|
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.
|
|
#
|
abstract
public
|
getName(): string
Gets the name of this type.
Gets the name of this type.
|
#
|
final
public
static
|
getTypeRegistry(): 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
|
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 {@link ParameterType} constants.
|
#
|
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
|
__toString(): string
Deprecated
Relying on string representation is discouraged and will be removed in DBAL 3.0.
|
#
|
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 {@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, 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.
|
#
|