From 2125718d30adea6caa5734d01dd45da8ac44f7ab Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 29 Oct 2007 23:34:09 +0000 Subject: [PATCH] important hint about which columns local and foreign refer to in Many-To-Many relationships Ticket: 538 --- manual/docs/en/relations.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manual/docs/en/relations.txt b/manual/docs/en/relations.txt index 3bf9cf02d..e046bdc3b 100644 --- a/manual/docs/en/relations.txt +++ b/manual/docs/en/relations.txt @@ -181,8 +181,8 @@ class User extends Doctrine_Record { public function setUp() { - $this->hasMany('Group', array('local' => 'user_id', - 'foreign' => 'group_id', + $this->hasMany('Group', array('local' => 'user_id', // <- these are the column names + 'foreign' => 'group_id', // <- in the association table // the following line is needed in many-to-many relations! 'refClass' => 'GroupUser')); @@ -196,8 +196,8 @@ class User extends Doctrine_Record class Group extends Doctrine_Record { public function setUp() { - $this->hasMany('User', array('local' => 'group_id', - 'foreign' => 'user_id', + $this->hasMany('User', array('local' => 'group_id', // <- these are the column names + 'foreign' => 'user_id', // <- in the association table // the following line is needed in many-to-many relations! 'refClass' => 'GroupUser')); }