php - zend expressive + doctrine custom types -


i'm trying map custom type string. here's entity definition:

/**  * @var string  *   * @orm\column(name="type", type="string", columndefinition="my_type_enum", nullable=false)  */ 

but when try create migration (migration:diff) output

[doctrine\dbal\dbalexception] unknown database type my_type_enum requested, doctrine\dbal\platforms\postgresql92platform may not suppo rt it.

seems need map custom type my_type_enum string using mapping_types, in zend expressive? it's seems configuration ignored

...      'doctrine' => [        'dbal' => [          'mapping_types' => [            'my_type_enum' => 'string'          ]        ]      ] ... 

zend-expressive doesn't have doctrine support build in. depends on doctrine module , factory using. factory starts doctrine service config. inside doctrine factory figure out how , if supports custom mapping types.

in case yours doesn't support it, can use container-interop-doctrine. has support built in seems (haven't tried myself):

<?php return [     'doctrine' => [         // ...         'connection' => [             'orm_default' => [                 'driver_class' => \doctrine\dbal\driver\pdomysql\driver::class,                 'wrapper_class' => null,                 'pdo' => null,                 'configuration' => 'orm_default',                  'event_manager' => 'orm_default',                  'params' => [],                 'doctrine_mapping_types' => [], // <-----                 'doctrine_commented_types' => [],             ],         ],     ], ]; 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -