class Types (View source)

Class holding type definitions for MySQL and MariaDB.

Constants

private UNARY_OPERATORS

private NULL_OPERATORS

private ENUM_OPERATORS

private TEXT_OPERATORS

private NUMBER_OPERATORS

private UUID_OPERATORS

Methods

__construct(DatabaseInterface $dbi)

No description

bool
isUnaryOperator(string $op)

Check whether operator is unary.

array
getTypeOperators(string $type, bool $null)

Returns operators for given type

string
getTypeOperatorsHtml(string $type, bool $null, string|null $selectedOperator = null)

Returns operators for given type as html options

string
getTypeDescription(string $type)

Returns the data type description.

TypeClass
getTypeClass(string $type)

Returns class of a type, used for functions available for type or default values.

array
getFunctionsClass(TypeClass $class)

Returns array of functions available for a class.

array
getAllFunctions()

Returns array of all functions available.

array
getAttributes()

Returns array of all attributes available.

array
getColumns()

Returns array of all column types available.

array
getIntegerTypes()

Returns an array of integer types

string
mapAliasToMysqlType(string $alias)

No description

array
getFloatTypes()

Returns an array of float types

array
getIntegerRange(string $type, bool $signed = true)

Returns the min and max values of a given integer type

Details

__construct(DatabaseInterface $dbi)

No description

Parameters

DatabaseInterface $dbi

bool isUnaryOperator(string $op)

Check whether operator is unary.

Parameters

string $op

operator name

Return Value

bool

array getTypeOperators(string $type, bool $null)

Returns operators for given type

Parameters

string $type

Type of field

bool $null

Whether field can be NULL

Return Value

array

string getTypeOperatorsHtml(string $type, bool $null, string|null $selectedOperator = null)

Returns operators for given type as html options

Parameters

string $type

Type of field

bool $null

Whether field can be NULL

string|null $selectedOperator

Option to be selected

Return Value

string

Generated Html

string getTypeDescription(string $type)

Returns the data type description.

Parameters

string $type

The data type to get a description.

Return Value

string

TypeClass getTypeClass(string $type)

Returns class of a type, used for functions available for type or default values.

Parameters

string $type

The data type to get a class.

Return Value

TypeClass

array getFunctionsClass(TypeClass $class)

Returns array of functions available for a class.

Parameters

TypeClass $class

Return Value

array

array getAllFunctions()

Returns array of all functions available.

Return Value

array

array getAttributes()

Returns array of all attributes available.

Return Value

array

array getColumns()

Returns array of all column types available.

VARCHAR, TINYINT, TEXT and DATE are listed first, based on estimated popularity.

Return Value

array

array getIntegerTypes()

Returns an array of integer types

Return Value

array

integer types

string mapAliasToMysqlType(string $alias)

No description

Parameters

string $alias

Return Value

string

array getFloatTypes()

Returns an array of float types

Return Value

array

float types

array getIntegerRange(string $type, bool $signed = true)

Returns the min and max values of a given integer type

Parameters

string $type

integer type

bool $signed

whether signed

Return Value

array