0
我正在使用embedRelation('ProductProperty')編輯產品及其當前屬性。目前爲止,一切都很好。這裏的E/R圖http://d.pr/1N7RSymfony:以ID形式將EmbedRelations拆分爲表格
但是,現在我想根據它的SetID在不同的AJAX選項卡中分割表單和顯示屬性集。我仍然想要一個「保存」按鈕,但如果我需要多個按鈕,這並不重要。我怎樣才能做到這一點?
在我的_form.php我迭代集,但我似乎無法獲得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