1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/tests_old/models/MyGroup.php
2008-02-08 17:41:01 +00:00

18 lines
559 B
PHP

<?php
class MyGroup extends Doctrine_Record
{
public function setTableDefinition()
{
$this->setTableName('my_group');
$this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,));
$this->hasColumn('name', 'string', 255, array ( 'notnull' => true,));
$this->hasColumn('description', 'string', 4000, array ());
}
public function setUp()
{
$this->hasMany('MyUser as users', array('refClass' => 'MyUserGroup', 'local' => 'group_id', 'foreign' => 'user_id'));
}
}