製品とその現在のプロパティを、embedRelation('ProductProperty') を使用してフォームで編集しています。これまでのところ、すべてが良好です。E/R ダイアグラムはこちらhttp://d.pr/1N7R
ただし、フォームを分割し、SetID に従って異なる AJAX タブに属性セットを表示したいと考えています。「保存」ボタンは 1 つにしたいのですが、複数ある必要があるかどうかは重要ではありません。これどうやってするの?
私の _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