DateTimeImmutableType
extends DateTimeType
in package
Immutable type of {@see DateTimeType}.
Table of Contents
- BUILTIN_TYPES_MAP = [\Doctrine\DBAL\Types\Types::ARRAY => \Doctrine\DBAL\Types\ArrayType::class, \Doctrine\DBAL\Types\Types::ASCII_STRING => \Doctrine\DBAL\Types\AsciiStringType::class, \Doctrine\DBAL\Types\Types::BIGINT => \Doctrine\DBAL\Types\BigIntType::class, \Doctrine\DBAL\Types\Types::BINARY => \Doctrine\DBAL\Types\BinaryType::class, \Doctrine\DBAL\Types\Types::BLOB => \Doctrine\DBAL\Types\BlobType::class, \Doctrine\DBAL\Types\Types::BOOLEAN => \Doctrine\DBAL\Types\BooleanType::class, \Doctrine\DBAL\Types\Types::DATE_MUTABLE => \Doctrine\DBAL\Types\DateType::class, \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE => \Doctrine\DBAL\Types\DateImmutableType::class, \Doctrine\DBAL\Types\Types::DATEINTERVAL => \Doctrine\DBAL\Types\DateIntervalType::class, \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE => \Doctrine\DBAL\Types\DateTimeType::class, \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE => \Doctrine\DBAL\Types\DateTimeImmutableType::class, \Doctrine\DBAL\Types\Types::DATETIMETZ_MUTABLE => \Doctrine\DBAL\Types\DateTimeTzType::class, \Doctrine\DBAL\Types\Types::DATETIMETZ_IMMUTABLE => \Doctrine\DBAL\Types\DateTimeTzImmutableType::class, \Doctrine\DBAL\Types\Types::DECIMAL => \Doctrine\DBAL\Types\DecimalType::class, \Doctrine\DBAL\Types\Types::FLOAT => \Doctrine\DBAL\Types\FloatType::class, \Doctrine\DBAL\Types\Types::GUID => \Doctrine\DBAL\Types\GuidType::class, \Doctrine\DBAL\Types\Types::INTEGER => \Doctrine\DBAL\Types\IntegerType::class, \Doctrine\DBAL\Types\Types::JSON => \Doctrine\DBAL\Types\JsonType::class, \Doctrine\DBAL\Types\Types::OBJECT => \Doctrine\DBAL\Types\ObjectType::class, \Doctrine\DBAL\Types\Types::SIMPLE_ARRAY => \Doctrine\DBAL\Types\SimpleArrayType::class, \Doctrine\DBAL\Types\Types::SMALLINT => \Doctrine\DBAL\Types\SmallIntType::class, \Doctrine\DBAL\Types\Types::STRING => \Doctrine\DBAL\Types\StringType::class, \Doctrine\DBAL\Types\Types::TEXT => \Doctrine\DBAL\Types\TextType::class, \Doctrine\DBAL\Types\Types::TIME_MUTABLE => \Doctrine\DBAL\Types\TimeType::class, \Doctrine\DBAL\Types\Types::TIME_IMMUTABLE => \Doctrine\DBAL\Types\TimeImmutableType::class]
- The map of supported doctrine mapping types.
- $typeRegistry : TypeRegistry|null
- addType() : void
- Adds a custom type to the type map.
- canRequireSQLConversion() : bool
- Does working with this column require SQL conversion functions?
- convertToDatabaseValue() : mixed
- Converts a value from its PHP representation to its database representation of this type.
- convertToDatabaseValueSQL() : string
- Modifies the SQL expression (identifier, parameter) to convert to a database value.
- convertToPHPValue() : mixed
- Converts a value from its database representation to its PHP representation of this type.
- convertToPHPValueSQL() : string
- Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
- getBindingType() : int
- Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements.
- getMappedDatabaseTypes() : array<string|int, string>
- Gets an array of database types that map to this Doctrine type.
- getName() : string
- Gets the name of this type.
- getSQLDeclaration() : string
- Gets the SQL declaration snippet for a column of this type.
- getType() : Type
- Factory method to create type instances.
- getTypeRegistry() : TypeRegistry
- getTypesMap() : array<string|int, string>
- Gets the types array map which holds all registered types and the corresponding type class
- hasType() : bool
- Checks if exists support for a type.
- overrideType() : void
- Overrides an already defined type to use a different implementation.
- requiresSQLCommentHint() : mixed
- {@inheritdoc}
- createTypeRegistry() : TypeRegistry
Constants
BUILTIN_TYPES_MAP
The map of supported doctrine mapping types.
private
mixed
BUILTIN_TYPES_MAP
= [\Doctrine\DBAL\Types\Types::ARRAY => \Doctrine\DBAL\Types\ArrayType::class, \Doctrine\DBAL\Types\Types::ASCII_STRING => \Doctrine\DBAL\Types\AsciiStringType::class, \Doctrine\DBAL\Types\Types::BIGINT => \Doctrine\DBAL\Types\BigIntType::class, \Doctrine\DBAL\Types\Types::BINARY => \Doctrine\DBAL\Types\BinaryType::class, \Doctrine\DBAL\Types\Types::BLOB => \Doctrine\DBAL\Types\BlobType::class, \Doctrine\DBAL\Types\Types::BOOLEAN => \Doctrine\DBAL\Types\BooleanType::class, \Doctrine\DBAL\Types\Types::DATE_MUTABLE => \Doctrine\DBAL\Types\DateType::class, \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE => \Doctrine\DBAL\Types\DateImmutableType::class, \Doctrine\DBAL\Types\Types::DATEINTERVAL => \Doctrine\DBAL\Types\DateIntervalType::class, \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE => \Doctrine\DBAL\Types\DateTimeType::class, \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE => \Doctrine\DBAL\Types\DateTimeImmutableType::class, \Doctrine\DBAL\Types\Types::DATETIMETZ_MUTABLE => \Doctrine\DBAL\Types\DateTimeTzType::class, \Doctrine\DBAL\Types\Types::DATETIMETZ_IMMUTABLE => \Doctrine\DBAL\Types\DateTimeTzImmutableType::class, \Doctrine\DBAL\Types\Types::DECIMAL => \Doctrine\DBAL\Types\DecimalType::class, \Doctrine\DBAL\Types\Types::FLOAT => \Doctrine\DBAL\Types\FloatType::class, \Doctrine\DBAL\Types\Types::GUID => \Doctrine\DBAL\Types\GuidType::class, \Doctrine\DBAL\Types\Types::INTEGER => \Doctrine\DBAL\Types\IntegerType::class, \Doctrine\DBAL\Types\Types::JSON => \Doctrine\DBAL\Types\JsonType::class, \Doctrine\DBAL\Types\Types::OBJECT => \Doctrine\DBAL\Types\ObjectType::class, \Doctrine\DBAL\Types\Types::SIMPLE_ARRAY => \Doctrine\DBAL\Types\SimpleArrayType::class, \Doctrine\DBAL\Types\Types::SMALLINT => \Doctrine\DBAL\Types\SmallIntType::class, \Doctrine\DBAL\Types\Types::STRING => \Doctrine\DBAL\Types\StringType::class, \Doctrine\DBAL\Types\Types::TEXT => \Doctrine\DBAL\Types\TextType::class, \Doctrine\DBAL\Types\Types::TIME_MUTABLE => \Doctrine\DBAL\Types\TimeType::class, \Doctrine\DBAL\Types\Types::TIME_IMMUTABLE => \Doctrine\DBAL\Types\TimeImmutableType::class]
Properties
$typeRegistry
private
static TypeRegistry|null
$typeRegistry
Methods
addType()
Adds a custom type to the type map.
public
static addType(string $name, class-string<\Doctrine\DBAL\Types\Type> $className) : void
Parameters
- $name : string
-
The name of the type. This should correspond to what getName() returns.
- $className : class-string<\Doctrine\DBAL\Types\Type>
-
The class name of the custom type.
Tags
Return values
void —canRequireSQLConversion()
Does working with this column require SQL conversion functions?
public
canRequireSQLConversion() : bool
This is a metadata function that is required for example in the ORM. Usage of and works for any type and mostly does nothing. This method can additionally be used for optimization purposes.
Return values
bool —convertToDatabaseValue()
Converts a value from its PHP representation to its database representation of this type.
public
convertToDatabaseValue(mixed $value, AbstractPlatform $platform) : mixed
Parameters
- $value : mixed
-
The value to convert.
- $platform : AbstractPlatform
-
The currently used database platform.
Return values
mixed —The database representation of the value.
convertToDatabaseValueSQL()
Modifies the SQL expression (identifier, parameter) to convert to a database value.
public
convertToDatabaseValueSQL(string $sqlExpr, AbstractPlatform $platform) : string
Parameters
- $sqlExpr : string
- $platform : AbstractPlatform
Return values
string —convertToPHPValue()
Converts a value from its database representation to its PHP representation of this type.
public
convertToPHPValue(mixed $value, AbstractPlatform $platform) : mixed
Parameters
- $value : mixed
-
The value to convert.
- $platform : AbstractPlatform
-
The currently used database platform.
Return values
mixed —The PHP representation of the value.
convertToPHPValueSQL()
Modifies the SQL expression (identifier, parameter) to convert to a PHP value.
public
convertToPHPValueSQL(string $sqlExpr, AbstractPlatform $platform) : string
Parameters
- $sqlExpr : string
- $platform : AbstractPlatform
Return values
string —getBindingType()
Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements.
public
getBindingType() : int
Return values
int —getMappedDatabaseTypes()
Gets an array of database types that map to this Doctrine type.
public
getMappedDatabaseTypes(AbstractPlatform $platform) : array<string|int, string>
Parameters
- $platform : AbstractPlatform
Return values
array<string|int, string> —getName()
Gets the name of this type.
public
getName() : string
Return values
string —getSQLDeclaration()
Gets the SQL declaration snippet for a column of this type.
public
abstract getSQLDeclaration(array<string|int, mixed> $column, AbstractPlatform $platform) : string
Parameters
- $column : array<string|int, mixed>
-
The column definition
- $platform : AbstractPlatform
-
The currently used database platform.
Return values
string —getType()
Factory method to create type instances.
public
static getType(string $name) : Type
Type instances are implemented as flyweights.
Parameters
- $name : string
-
The name of the type (as returned by getName()).
Tags
Return values
Type —getTypeRegistry()
public
final static getTypeRegistry() : TypeRegistry
Return values
TypeRegistry —getTypesMap()
Gets the types array map which holds all registered types and the corresponding type class
public
static getTypesMap() : array<string|int, string>
Return values
array<string|int, string> —hasType()
Checks if exists support for a type.
public
static hasType(string $name) : bool
Parameters
- $name : string
-
The name of the type.
Return values
bool —TRUE if type is supported; FALSE otherwise.
overrideType()
Overrides an already defined type to use a different implementation.
public
static overrideType(string $name, class-string<\Doctrine\DBAL\Types\Type> $className) : void
Parameters
- $name : string
- $className : class-string<\Doctrine\DBAL\Types\Type>
Tags
Return values
void —requiresSQLCommentHint()
{@inheritdoc}
public
requiresSQLCommentHint(AbstractPlatform $platform) : mixed
Parameters
- $platform : AbstractPlatform
Return values
mixed —createTypeRegistry()
private
static createTypeRegistry() : TypeRegistry