我正在使用 symfony 1.4 和 Propel 作为 ORM。我有一个需要在其中嵌入其他表单的表单。另一种形式是连接客户和某个对象的 n:m 关系。我不知道如何嵌入它,以便它为客户显示所有对象。
考虑到以下架构,我想在 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
你知道我在哪里可以找到这个问题的一些教程/解决方案吗?
非常感谢