Doctrine2 EnumType
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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