我正在使用 embedRelation('ProductProperty') 以表格形式编辑产品及其当前属性。到目前为止一切都很好。E/R 图在这里http://d.pr/1N7R
但是,现在我想根据其 SetID 拆分表单并在不同的 AJAX 选项卡中显示属性集。我仍然想要一个“保存”按钮,但如果我需要多个按钮并不重要。我怎样才能做到这一点?
在我的 _form.php 中,我正在迭代 Sets,但我似乎无法获得 ProductProperty 表单对象的 SetID。我会以错误的方式解决这个问题吗?
我正在使用 symfony 1.4 和 Doctrine 1.2。这是我的 schema.yml
Product:
tableName: products
actAs:
Timestampable: ~
Sluggable:
unique: true
fields: [title]
canUpdate: true
columns:
id:
type: integer
primary: true
autoincrement: true
category_id:
type: integer
notnull: true
sku:
type: string(50)
notnull: true
title:
type: string(150)
notnull: true
relations:
Category:
foreignType: many
foreignAlias: Products
Property:
tableName: properties
actAs:
Timestampable: ~
Sluggable:
unique: true
fields: [description]
canUpdate: true
columns:
id:
type: integer
primary: true
autoincrement: true
set_id:
type: integer
notnull: true
description:
type: string(100)
notnull: true
relations:
Set:
foreignType: many
foreignAlias: Properties
Set:
tableName: sets
actAs:
Timestampable: ~
columns:
id:
type: integer
primary: true
autoincrement: true
title:
type: string(100)
notnull: true
ProductProperty:
tableName: product_properties
actAs:
Timestampable: ~
columns:
product_id:
type: integer
primary: true
property_id:
type: integer
primary: true
value:
type: text
notnull: true
relations:
Product:
alias: Product
foreignType: many
foreignAlias: ProductProperties
onDelete: cascade
Property:
alias: Property
foreignType: many
foreignAlias: PropertyProperties
onDelete: cascade