Commit f23b69f6 authored by mahono's avatar mahono

fixed small bug in the many2many example

parent c5291aed
......@@ -161,12 +161,13 @@ class User extends Doctrine_Record
}
}
class Group extends Doctrine_Record {
class Group extends Doctrine_Record
{
public function setUp() {
$this->hasMany('Group', array('local' => 'group_id',
'foreign' => 'user_id',
$this->hasMany('User', array('local' => 'group_id',
'foreign' => 'user_id',
// the following line is needed in many-to-many relations!
'refClass' => 'GroupUser'));
'refClass' => 'GroupUser'));
}
public function setTableDefinition() {
$this->hasColumn('name', 'string', 30);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment