<?php

/**
 * BaseUser
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $username
 * @property string $password
 * @property string $test
 * @property Doctrine_Collection $Groups
 * @property Doctrine_Collection $Permissions
 * @property Profile $Profile
 * 
 * @method string              getUsername()    Returns the current record's "username" value
 * @method string              getPassword()    Returns the current record's "password" value
 * @method string              getTest()        Returns the current record's "test" value
 * @method Doctrine_Collection getGroups()      Returns the current record's "Groups" collection
 * @method Doctrine_Collection getPermissions() Returns the current record's "Permissions" collection
 * @method Profile             getProfile()     Returns the current record's "Profile" value
 * @method User                setUsername()    Sets the current record's "username" value
 * @method User                setPassword()    Sets the current record's "password" value
 * @method User                setTest()        Sets the current record's "test" value
 * @method User                setGroups()      Sets the current record's "Groups" collection
 * @method User                setPermissions() Sets the current record's "Permissions" collection
 * @method User                setProfile()     Sets the current record's "Profile" value
 * 
 * @package    symfony12
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseUser extends myDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('user');
        $this->hasColumn('username', 'string', 255, array(
             'type' => 'string',
             'unique' => true,
             'length' => 255,
             ));
        $this->hasColumn('password', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('test', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Group as Groups', array(
             'refClass' => 'UserGroup',
             'local' => 'user_id',
             'foreign' => 'group_id'));

        $this->hasMany('Permission as Permissions', array(
             'refClass' => 'UserPermission',
             'local' => 'user_id',
             'foreign' => 'permission_id'));

        $this->hasOne('Profile', array(
             'local' => 'id',
             'foreign' => 'user_id'));
    }
}