Menu

## EnumType extends Type
in package

EnumType.php : 19

Creating a custom enum type for integration with doctrine/dbal

##### Tags

link
  http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/custom-mapping-types.html
link
  http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/mysql-enums.html
internal

### Table of Contents

TYPENAME = 'enum'
$values : mixed
convertToDatabaseValue() : mixed
  This is executed when the value is written to the database. Make your conversions here, optionally using the $platform.
convertToPHPValue() : mixed
  This is executed when the value is read from the database. Make your conversions here, optionally using the $platform.
getName() : mixed
getSQLDeclaration() : mixed
  return the SQL used to create your column type. To create a portable column type, use the $platform.
registerDoctrineEnumMapping() : void
  Creating custom type to deal with ENUM.
requiresSQLCommentHint() : mixed

### Constants

#### TYPENAME

EnumType.php : 21
`public mixed TYPENAME = 'enum'`

### Properties

#### $values

EnumType.php : 22
`protected mixed $values = array()`

### Methods

#### convertToDatabaseValue()

EnumType.php : 52

This is executed when the value is written to the database. Make your conversions here, optionally using the $platform.

`public convertToDatabaseValue(mixed $value, AbstractPlatform $platform) : mixed`

##### Parameters

$value : mixed
$platform : AbstractPlatform

##### Return values

mixed —

#### convertToPHPValue()

EnumType.php : 46

This is executed when the value is read from the database. Make your conversions here, optionally using the $platform.

`public convertToPHPValue(mixed $value, AbstractPlatform $platform) : mixed`

##### Parameters

$value : mixed
$platform : AbstractPlatform

##### Return values

mixed —

#### getName()

EnumType.php : 60
`public getName() : mixed`

##### Return values

mixed —

#### getSQLDeclaration()

EnumType.php : 38

return the SQL used to create your column type. To create a portable column type, use the $platform.

`public getSQLDeclaration(array<string|int, mixed> $fieldDeclaration, AbstractPlatform $platform) : mixed`

##### Parameters

$fieldDeclaration : array<string|int, mixed>
$platform : AbstractPlatform

##### Return values

mixed —

#### registerDoctrineEnumMapping()

EnumType.php : 28

Creating custom type to deal with ENUM.

`public static registerDoctrineEnumMapping() : void`

##### Return values

void —

#### requiresSQLCommentHint()

EnumType.php : 65
`public requiresSQLCommentHint(AbstractPlatform $platform) : mixed`

##### Parameters

$platform : AbstractPlatform

##### Return values

mixed —

## Search results