class DateImmutableType extends DateType (View source)

Immutable type of {see DateType}.

Constants

TARRAY

SIMPLE_ARRAY

JSON_ARRAY

JSON

BIGINT

BOOLEAN

DATETIME

DATETIME_IMMUTABLE

DATETIMETZ

DATETIMETZ_IMMUTABLE

DATE

DATE_IMMUTABLE

TIME

TIME_IMMUTABLE

DECIMAL

INTEGER

OBJECT

SMALLINT

STRING

TEXT

BINARY

BLOB

FLOAT

GUID

DATEINTERVAL

Methods

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.

string
getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)

Gets the SQL declaration snippet for a field of this type.

from DateType
string
getName()

Gets the name of this type.

static Type
getType(string $name)

Factory method to create type instances.

from Type
static void
addType(string $name, string $className)

Adds a custom type to the type map.

from Type
static bool
hasType(string $name)

Checks if exists support for a type.

from Type
static void
overrideType(string $name, string $className)

Overrides an already defined type to use a different implementation.

from Type
int
getBindingType()

Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements.

from Type
static string[]
getTypesMap()

Gets the types array map which holds all registered types and the corresponding type class

from Type
bool
canRequireSQLConversion()

Does working with this column require SQL conversion functions?

from Type
string
convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)

Modifies the SQL expression (identifier, parameter) to convert to a database value.

from Type
string
convertToPHPValueSQL(string $sqlExpr, AbstractPlatform $platform)

Modifies the SQL expression (identifier, parameter) to convert to a PHP value.

from Type
string[]
getMappedDatabaseTypes(AbstractPlatform $platform)

Gets an array of database types that map to this Doctrine type.

from Type
bool
requiresSQLCommentHint(AbstractPlatform $platform)

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.

Details

mixed convertToDatabaseValue(mixed $value, AbstractPlatform $platform)

Converts a value from its PHP representation to its database representation of this type.

Parameters

mixed $value The value to convert.
AbstractPlatform $platform The currently used database platform.

Return Value

mixed The database representation of the value.

mixed convertToPHPValue(mixed $value, AbstractPlatform $platform)

Converts a value from its database representation to its PHP representation of this type.

Parameters

mixed $value The value to convert.
AbstractPlatform $platform The currently used database platform.

Return Value

mixed The PHP representation of the value.

string getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)

Gets the SQL declaration snippet for a field of this type.

Parameters

array $fieldDeclaration The field declaration.
AbstractPlatform $platform The currently used database platform.

Return Value

string

string getName()

Gets the name of this type.

Return Value

string

static Type getType(string $name)

Factory method to create type instances.

Type instances are implemented as flyweights.

Parameters

string $name The name of the type (as returned by getName()).

Return Value

Type

Exceptions

DBALException

static void addType(string $name, string $className)

Adds a custom type to the type map.

Parameters

string $name The name of the type. This should correspond to what getName() returns.
string $className The class name of the custom type.

Return Value

void

Exceptions

DBALException

static bool hasType(string $name)

Checks if exists support for a type.

Parameters

string $name The name of the type.

Return Value

bool TRUE if type is supported; FALSE otherwise.

static void overrideType(string $name, string $className)

Overrides an already defined type to use a different implementation.

Parameters

string $name
string $className

Return Value

void

Exceptions

DBALException

int 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 {@link \Doctrine\DBAL\ParameterType} constants.

Return Value

int

static string[] getTypesMap()

Gets the types array map which holds all registered types and the corresponding type class

Return Value

string[]

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.

Return Value

bool

string convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)

Modifies the SQL expression (identifier, parameter) to convert to a database value.

Parameters

$sqlExpr
AbstractPlatform $platform

Return Value

string

string convertToPHPValueSQL(string $sqlExpr, AbstractPlatform $platform)

Modifies the SQL expression (identifier, parameter) to convert to a PHP value.

Parameters

string $sqlExpr
AbstractPlatform $platform

Return Value

string

string[] getMappedDatabaseTypes(AbstractPlatform $platform)

Gets an array of database types that map to this Doctrine type.

Parameters

AbstractPlatform $platform

Return Value

string[]

bool requiresSQLCommentHint(AbstractPlatform $platform)

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.

Parameters

AbstractPlatform $platform

Return Value

bool