Doctrine


Doctrine\DBAL\Types\SmallIntType
/Doctrine/DBAL/Types/SmallIntType.php at line 31

Class SmallIntType

Class:SmallIntType - Superclass: Type
Type
⌊ SmallIntType

public class SmallIntType
extends Type

Type that maps a database SMALLINT to a PHP integer.

Author:
robo
Since:
2.0

Fields inherited from Doctrine\DBAL\Types\Type
BIGINT, BOOLEAN, DATE, DATETIME, DECIMAL, INTEGER, OBJECT, SMALLINT, STRING, TARRAY, TEXT, TIME
Method Summary
mixed

convertToPHPValue(mixed value, AbstractPlatform platform)

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

integer

getBindingType()

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

string

getName()

Gets the name of this type.

void

getSqlDeclaration(array fieldDeclaration, AbstractPlatform platform)

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

Methods inherited from Doctrine\DBAL\Types\Type
addType, convertToDatabaseValue, convertToPHPValue, getBindingType, getDefaultLength, getName, getSqlDeclaration, getType, getTypesMap, hasType, overrideType

Method Detail

/Doctrine/DBAL/Types/SmallIntType.php at line 43

convertToPHPValue

public mixed convertToPHPValue(mixed value, AbstractPlatform platform)

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.

/Doctrine/DBAL/Types/SmallIntType.php at line 48

getBindingType

public 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


/Doctrine/DBAL/Types/SmallIntType.php at line 33

getName

public string getName()

Gets the name of this type.

Todo:
Needed?

/Doctrine/DBAL/Types/SmallIntType.php at line 38

getSqlDeclaration

public void getSqlDeclaration(array fieldDeclaration, AbstractPlatform platform)

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

Parameters:
fieldDeclaration - The field declaration.
platform - The currently used database platform.

Doctrine