MediaWiki master
Wikimedia\Rdbms\EnumType Class Reference

Custom handling for ENUM datatype. More...

Inherits Type.

Collaboration diagram for Wikimedia\Rdbms\EnumType:

Public Member Functions

 formatValues ( $values)
 Get the imploded values suitable for pushing directly into ENUM();.
 
 getName ()
 
 getSQLDeclaration (array $column, AbstractPlatform $platform)
 Gets the SQL declaration snippet for an ENUM column.
 
 makeEnumTypeSql ( $column, $platform)
 Gets the sql portion to create ENUM for Postgres table column.
 

Public Attributes

const ENUM = 'mwenum'
 

Detailed Description

Custom handling for ENUM datatype.

NOTE: Use of this type is discouraged unless necessary. Please use alternative types where possible. See T119173 for the RFC discussion about this type and potential alternatives.

See also
https://phabricator.wikimedia.org/T119173

Definition at line 18 of file EnumType.php.

Member Function Documentation

◆ formatValues()

Wikimedia\Rdbms\EnumType::formatValues ( $values)

Get the imploded values suitable for pushing directly into ENUM();.

Parameters
string[]$values
Returns
string

Definition at line 83 of file EnumType.php.

Referenced by Wikimedia\Rdbms\EnumType\getSQLDeclaration(), and Wikimedia\Rdbms\EnumType\makeEnumTypeSql().

◆ getName()

Wikimedia\Rdbms\EnumType::getName ( )

Definition at line 90 of file EnumType.php.

References Wikimedia\Rdbms\EnumType\ENUM.

◆ getSQLDeclaration()

Wikimedia\Rdbms\EnumType::getSQLDeclaration ( array $column,
AbstractPlatform $platform )

Gets the SQL declaration snippet for an ENUM column.

Parameters
mixed[]$columnColumn definition
AbstractPlatform$platform
Returns
string

Definition at line 29 of file EnumType.php.

References Wikimedia\Rdbms\EnumType\formatValues().

◆ makeEnumTypeSql()

Wikimedia\Rdbms\EnumType::makeEnumTypeSql ( $column,
$platform )

Gets the sql portion to create ENUM for Postgres table column.

Parameters
mixed[]$column
AbstractPlatform$platform
See also
MWPostgreSqlPlatform::_getCreateTableSQL()
Exceptions

\InvalidArgumentException

Returns
string

Definition at line 63 of file EnumType.php.

References Wikimedia\Rdbms\EnumType\formatValues().

Member Data Documentation

◆ ENUM

const Wikimedia\Rdbms\EnumType::ENUM = 'mwenum'

Definition at line 19 of file EnumType.php.

Referenced by Wikimedia\Rdbms\EnumType\getName().


The documentation for this class was generated from the following file: