嗨我正在開發一個symfony電影數據庫應用程序,面臨的問題很少。sql symfony實體關係orm電影數據庫
我有一個實體的內容(電影):
Bbd\MyAppBundle\Entity\Content:
type: entity
repositoryClass: Bbd\MyAppBundle\Repository\ContentRepository
table: content
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
title:
type: string
length: 120
unique: true
....
然後,我有藝術家:
Bbd\MyAppBundle\Entity\Artist:
type: entity
table: artist
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
name:
type: string
length: 255
unique: true
然後,我有作用:現在
type: entity
table: role
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
name: ~
,一個內容將有許多角色,如:演員,女演員,導演..一位藝術家可能在一個內容中扮演很多角色。現在我不知道如何構建關係實體表。我想要一個表格,其中content_id,role_id,artist_id將被保存。
接下來的問題是我想從內容表單輸入所有數據,我希望從db中的所有角色都將顯示爲HTML標籤,並在其藝術家名稱框下拉列表旁邊。我真的不知道該怎麼做。有沒有什麼建議或者有更好的用戶友好的gui?
您昨天有此問題? http://stackoverflow.com/questions/29692163/symfony2-many-to-many-relational-db-structure – ghanbari