【发布时间】:2016-02-10 22:01:24
【问题描述】:
我必须在学说实体的注释中输入什么。
其实是这样的……
/**
* @ORM\Column(type="string", length=255)
*
* @Assert\Length(
* min=3,
* max=255,
* minMessage="The name is too short.",
* maxMessage="The name is too long.",
* groups={"Registration", "Profile"}
* )
*/
protected $name;
我必须告诉教义像canBeNull=true 这样的东西。否则我总是收到此错误SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null
但是代码是什么?
【问题讨论】:
-
@ORM\Column(type="string", length=255, nullable=true)
-
如果你在谷歌上搜索“空的学说”,那将是第一个结果,在该学说页面上,搜索“空”
标签: php doctrine entity symfony