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
|
|
|
|
{
|
2008-02-04 00:29:57 +03:00
|
|
|
public static function initMetadata($class)
|
2007-09-05 08:42:02 +04:00
|
|
|
{
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->hasMany('User', array(
|
2007-09-05 08:42:02 +04:00
|
|
|
'local' => 'group_id',
|
|
|
|
'foreign' => 'user_id',
|
2008-02-04 00:29:57 +03:00
|
|
|
'refClass' => 'Groupuser'
|
2007-09-05 08:42:02 +04:00
|
|
|
));
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|