1
0
mirror of synced 2024-12-13 14:56:01 +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'));
}
}