MediaWiki  master
Wikimedia\Rdbms\EnumType Class Reference

Custom handling for ENUM datatype. More...

Inheritance diagram for Wikimedia\Rdbms\EnumType:
Collaboration diagram for Wikimedia\Rdbms\EnumType:

Public Member Functions

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

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 17 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 82 of file EnumType.php.

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

◆ getName()

Wikimedia\Rdbms\EnumType::getName ( )

Definition at line 89 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 28 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[]$columnColumn
AbstractPlatform$platform
See also
MWPostgreSqlPlatform::_getCreateTableSQL()
Exceptions

Definition at line 62 of file EnumType.php.

References Wikimedia\Rdbms\EnumType\formatValues().

Member Data Documentation

◆ ENUM

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

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