Skip to content

Instantly share code, notes, and snippets.

Created December 13, 2010 11:31
What would you like to do?
Doctrine2 EnumType
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
* My custom datatype.
class EnumType extends Type
const ENUM = 'enum';
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
// not relevant for this example
public function getName()
return self::ENUM;
Type::addType('enum', 'EnumType');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment