如何在学说 2 中设置枚举数据类型 [英] How do I set enum data type in doctrine 2

查看:17
本文介绍了如何在学说 2 中设置枚举数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在基于注解的映射中,根据学说的文档,我们可以做如下所示:

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

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

我的问题是如何在学说的 yaml 元数据文件中表示这一点?

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

我想做这样的事情:

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

我使用 symfony 2 作为框架

I am using symfony 2 as framework

推荐答案

只需使用:

fields:
status:
  type: string
  columnDefinition: ENUM('visible', 'invisible')

这篇关于如何在学说 2 中设置枚举数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆