Og her går vi:Du har angivet de samme aliaser for relationerne.
User:
relations:
viewed_by:
class: View
local: user_id
foreign: viewed_id
type: many
foreignType: one
foreignAlias: viewed
viewed:
class: View
local: user_id
foreign: viewer_id
type: many
foreignType: one
foreignAlias: viewer
Eller du sætter hele mange-til-mange-relationen anderledes op:
User:
relations:
viewed_by:
class: User
local: viewed_id
foreign: viewer_id,
refClass: View
viewed:
class: User
local:viewer_id
foreign: viewed_id
refClass: View
og View
skal se ud
View:
columns:
viewed_id:
type: integer
primary: true
viewer_id:
type: integer
primary: true
Se Doctrine-dokumentationen på mange-til-mange-forhold .