How do I set enum data type in doctrine 2

2019-04-08 07:20发布

In annotation based mapping, as per the documentation of doctrine, we can do as shown below:

/** @Column(type="string", columnDefinition="ENUM('visible', 'invisible')") */

My question is how do I represent this in yaml meta data file for doctrine?

I want to do something like this:

fields:
status:
  type: string
  columnDefinition: ....

I am using symfony 2 as framework

2条回答
冷血范
3楼-- · 2019-04-08 07:39

Just use:

fields:
status:
  type: string
  columnDefinition: ENUM('visible', 'invisible')
查看更多
登录 后发表回答