2007-09-02 18:24:49 +04:00
|
|
|
<?php
|
|
|
|
|
2007-09-03 19:32:30 +04:00
|
|
|
require_once('Entity.php');
|
|
|
|
|
2007-09-05 08:42:02 +04:00
|
|
|
// grouptable doesn't extend Doctrine_Table -> Doctrine_Connection
|
|
|
|
// won't initialize grouptable when Doctrine_Connection->getTable('Group') is called
|
2007-09-02 18:24:49 +04:00
|
|
|
class GroupTable { }
|
2007-09-05 08:42:02 +04:00
|
|
|
|
|
|
|
class Group extends Entity
|
|
|
|
{
|
|
|
|
public function setUp()
|
|
|
|
{
|
2007-09-02 18:24:49 +04:00
|
|
|
parent::setUp();
|
2007-09-05 08:42:02 +04:00
|
|
|
$this->hasMany('User', array(
|
|
|
|
'local' => 'group_id',
|
|
|
|
'foreign' => 'user_id',
|
|
|
|
'refClass' => 'Groupuser',
|
2008-01-05 22:55:56 +03:00
|
|
|
'refRelationName' => 'GroupGroupuser',
|
|
|
|
'refReverseRelationName' => 'UserGroupuser'
|
2007-09-05 08:42:02 +04:00
|
|
|
));
|
2008-01-05 22:55:56 +03:00
|
|
|
/*$this->hasMany('Groupuser as User', array(
|
|
|
|
'local' => 'id', 'foreign' => 'group_id'
|
|
|
|
));*/
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|