<?php

/**
 * BaseUserGroup
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $title
 * @property Doctrine_Collection $UserGroupPermissions
 * @property Doctrine_Collection $User
 * @property Doctrine_Collection $UserGroupUsers
 * 
 * @method string              getTitle()                Returns the current record's "title" value
 * @method Doctrine_Collection getUserGroupPermissions() Returns the current record's "UserGroupPermissions" collection
 * @method Doctrine_Collection getUser()                 Returns the current record's "User" collection
 * @method Doctrine_Collection getUserGroupUsers()       Returns the current record's "UserGroupUsers" collection
 * @method UserGroup           setTitle()                Sets the current record's "title" value
 * @method UserGroup           setUserGroupPermissions() Sets the current record's "UserGroupPermissions" collection
 * @method UserGroup           setUser()                 Sets the current record's "User" collection
 * @method UserGroup           setUserGroupUsers()       Sets the current record's "UserGroupUsers" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseUserGroup extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('user_group');
        $this->hasColumn('title', 'string', 128, array(
             'type' => 'string',
             'notnull' => true,
             'unique' => true,
             'length' => 128,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Permission as UserGroupPermissions', array(
             'refClass' => 'UserGroupPermissions',
             'local' => 'user_group_id',
             'foreign' => 'permission_id',
             'onDelete' => 'CASCADE'));

        $this->hasMany('User', array(
             'refClass' => 'UserGroupUsers',
             'local' => 'user_group_id',
             'foreign' => 'user_id'));

        $this->hasMany('UserGroupUsers', array(
             'local' => 'id',
             'foreign' => 'user_group_id'));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $this->actAs($timestampable0);
    }
}