1
我使用symfony 1.4和Propel作爲ORM。我有一個需要在其中嵌入其他表單的表單。另一種形式是連接客戶和某個對象的n:m關係。我找不到如何嵌入它,以便顯示客戶的所有對象。Symfony嵌入式表格 - 多對多關係
考慮到以下模式,我想在Customer窗體中嵌入CustomerCountryGroup窗體,以顯示與用戶相關的CuountryGroup對象列表。
這裏是我的schema.yml:
Customer:
_attributes: { phpName: Customer }
id:
phpName: Id
type: INTEGER
size: '11'
primaryKey: true
autoIncrement: true
required: true
CustomerCountryGroup:
_attributes: { phpName: CustomerCountryGroup }
id:
phpName: Id
type: INTEGER
size: '10'
primaryKey: true
autoIncrement: true
required: true
customerId:
phpName: CustomerId
type: INTEGER
size: '10'
required: false
foreignTable: Customers
foreignReference: id
onDelete: CASCADE
onUpdate: RESTRICT
countryGroupId:
phpName: CountryGroupId
type: INTEGER
size: '10'
required: false
foreignTable: CountryGroups
foreignReference: id
onDelete: CASCADE
onUpdate: RESTRICT
CountryGroup:
_attributes: { phpName: CountryGroup }
id:
phpName: Id
type: INTEGER
size: '11'
primaryKey: true
autoIncrement: true
required: true
你知道我在哪裏可以找到這個問題的一些教程/解決方案?
非常感謝