我正在尝试从 yaml 模式生成学说模型
我有这样的架构:
Product:
columns:
id:
type: integer(5)
primary: true
unsigned: true
autoincrement: true
activation_time:
type: datetime
notnull: true
enduser_id:
type: integer(5)
unsigned: true
notnull: true
relations:
Enduser:
foreignType: one
type: one
foreignAlias: Product
Hostid:
columns:
id:
type: integer(5)
primary: true
unsigned: true
autoincrement: true
value:
type: string(32)
fixed: true
notnull: true
Order:
columns:
id:
type: integer(5)
primary: true
autoincrement: true
unsigned: true
expire_date:
type: datetime
description:
type: clob
Enduser:
columns:
id:
type: integer(5)
primary: true
unsigned: true
autoincrement: true
hostid_id:
type: integer(5)
unsigned: true
notnull: true
order_id:
type: integer(5)
unsigned: true
notnull: true
relations:
Order:
foreignAlias: Endusers
Hostid:
foreignAlias: Endusers
问题是由学说 generate-models-yaml 生成的模型在 BaseEnduser 中是错误的 $Product 被定义为 Doctrine_Collection
$this->hasMany('Product', array('local' => 'id', 'foreign' => 'enduser_id'));
而只是 Product 对象
我做错了什么?
关系被定义为foreignType:一种类型:一种