class ObjectType extends Type (View source)

Type that maps a PHP object to a clob SQL type.

Constants

TARRAY

BIGINT

BOOLEAN

DATETIME

DATETIMETZ

DATE

TIME

DECIMAL

INTEGER

OBJECT

SMALLINT

STRING

TEXT

FLOAT

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.

getDefaultLength(AbstractPlatform $platform)

Gets the default length of this type.

from Type
getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)

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

string
getName()

Gets the name of this type.

static Type
getType(string $name)

Factory method to create type instances.

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

Adds a custom type to the type map.

from Type
static boolean
hasType(string $name)

Checks if exists support for a type.

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

Overrides an already defined type to use a different implementation.

from Type
integer
getBindingType()

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

from Type
static array
getTypesMap()

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

from Type
__toString()

No description

from 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.

getDefaultLength(AbstractPlatform $platform)

Gets the default length of this type.

Parameters

AbstractPlatform $platform

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.

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 addType(string $name, string $className)

Adds a custom type to the type map.

Parameters

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

Exceptions

DBALException

static boolean hasType(string $name)

Checks if exists support for a type.

Parameters

string $name Name of the type

Return Value

boolean TRUE if type is supported; FALSE otherwise

static overrideType(string $name, string $className)

Overrides an already defined type to use a different implementation.

Parameters

string $name
string $className

Exceptions

DBALException

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

Return Value

integer

static array getTypesMap()

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

Return Value

array $typesMap

__toString()