Dan ini dia:Anda menentukan alias yang sama untuk relasi.
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
Atau Anda mengatur seluruh relasi banyak-ke-banyak secara berbeda:
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
dan View
seharusnya terlihat seperti
View:
columns:
viewed_id:
type: integer
primary: true
viewer_id:
type: integer
primary: true
Lihat dokumentasi Doktrin di hubungan banyak-ke-banyak .