假设我的 YAML 方案看起来像这样:
Note:
options:
type: MyISAM
collate: utf8_unicode_ci
charset: utf8
actAs: { Timestampable: ~ }
columns:
content: { type: string, notnull: true}
order_id: int(5)
user_id : int
relations:
User:
foreignAlias: Notes
local: user_id
foreign: id
type: one
foreignType: man
onDelete: CASCADE
执行时:
$note->setOrderId(0);
$note->save();
我收到以下错误:
1 validator failed on order_id (type)
MySQL 将 order_id 存储为 bigint(20)。
我正在使用 Ubuntu 9.10、Symfony 1.2、PHP 5 和 MySQL 5。
编辑 :
得到提示,如果我在 YAML 文件中删除所有提到的大小,我会收到 order_id (lenght) 的第二个验证器错误:-)