如何使用YAML設置多對一關係「區域」的外鍵名稱(編輯:不是屬性本身的名稱)?在Doctrine 2 ORM中命名關係?
SWA\TestBundle\Entity\Province:
type: entity
table: province
uniqueConstraints:
UNIQUE_PROVINCE_CODE:
columns: code
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
code:
type: integer
name:
type: string
length: 255
short_name:
type: string
length: 2
manyToOne:
region:
targetEntity: Region
inversedBy: provinces
所以沒有「標準」的方式來改變它 - 除了遷移程序?我想這個名字是完全隨機的,就像FK_28392f89329。 – gremo
那麼,你可能會重載平臺類,但我不認爲這是值得的,只是爲了約束的命名。 –
同意。謝謝,賞金+回答你! – gremo