我在entity中的字段设置了默认值,但是我在controller中实例的时候,还是会报参数缺失的错误。
/**
* @var integer
*
* @ORM\Column(name="lifetime", type="integer", nullable=true, options={"default":86400}))
*/
private $lifetime;
$sendEmailInfo = new SendEmails();
$sendEmail = $sendEmailInfo->setUid($id)->setEmail($email)->setKey($key)->setSalt($salt)->setCreateTime($time);
报错:
An exception occurred while executing 'INSERT INTO simple_sf_send_emails (uid, email, key, salt, createTime, lifetime) VALUES (?, ?, ?, ?, ?, ?)' with params [2, "example@qq.com", "8b2843f1714a19efa01e453dc1464148f00aa8fb", "nHA0", 1487300936, null]:
难道实例的时候我必须得set每一个字段么
直接在这里写就好了