Doctrine custom type always altering table

后端 未结 4 1834
醉话见心
醉话见心 2021-02-08 08:46

I have added a custom type like:

namespace My\\SuperBundle\\Types;

use Doctrine\\DBAL\\Types\\Type;
use Doctrine\\DBAL\\Platforms\\AbstractPlatform;

class Mo         


        
4条回答
  •  被撕碎了的回忆
    2021-02-08 09:14

    I had the same problem with ZF2.

    I solved it removing the hyphen in my custom type name.

    Wrong:

    'doctrine_type_mappings' => [
        'custom-type' => 'custom-type'
    ],
    

    Good:

    'doctrine_type_mappings' => [
        'customtype' => 'customtype'
    ],
    

    More details about implementation in Zend Framework 2: https://github.com/doctrine/DoctrineORMModule/blob/master/docs/EXTRAS_ORM.md

    I hope this can help someone.

提交回复
热议问题