shmaltorhbooks/doctrine-enum

Support of 'enum' type for Doctrine2

Installs: 10

Dependents: 0

Watchers: 1

Forks: 2

Open Issues: 1

Language: PHP

1.0.1 2014-02-05 15:40 UTC

README

Using enum type for Doctrine2 as string type.

Example

Register DBAL extension with plain PHP:

use \Doctrine\DBAL\Types\Type;
// ...

Type::addType('enum', 'Shmaltorhbooks\Doctrine\DBAL\Types\EnumType');
//...
// create conn options and doctrine config here
$em = EntityManager::create($connectionOptions, $config);

Register DBAL extension with symfony 2 framework:

your_app_folder/app/config/config.yml

doctrine:
  dbal:
    types:
      enum:
        class: Shmaltorhbooks\Doctrine\DBAL\Types\EnumType
        commented: false
  # ...
    connections:
      connection_name:
        # driver, port, pass, etc
        mapping_types:
          enum: string
          set: string
          varbinary: string