<?php
// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('User', 'doctrine');

/**
 * BaseUser
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property string $username
 * @property string $lastname
 * @property string $firstname
 * @property integer $type
 * @property integer $role
 * @property integer $org_id
 * @property string $pass_rd
 * @property integer $is_active
 * @property integer $is_close
 * @property string $password
 * @property string $email
 * @property integer $gender
 * @property date $birthday
 * @property string $image
 * @property string $description
 * @property integer $phone
 * @property timestamp $created_at
 * @property timestamp $last_seen_at
 * @property Organization $Organization
 * @property Doctrine_Collection $News
 * 
 * @method integer             getId()           Returns the current record's "id" value
 * @method string              getUsername()     Returns the current record's "username" value
 * @method string              getLastname()     Returns the current record's "lastname" value
 * @method string              getFirstname()    Returns the current record's "firstname" value
 * @method integer             getType()         Returns the current record's "type" value
 * @method integer             getRole()         Returns the current record's "role" value
 * @method integer             getOrgId()        Returns the current record's "org_id" value
 * @method string              getPassRd()       Returns the current record's "pass_rd" value
 * @method integer             getIsActive()     Returns the current record's "is_active" value
 * @method integer             getIsClose()      Returns the current record's "is_close" value
 * @method string              getPassword()     Returns the current record's "password" value
 * @method string              getEmail()        Returns the current record's "email" value
 * @method integer             getGender()       Returns the current record's "gender" value
 * @method date                getBirthday()     Returns the current record's "birthday" value
 * @method string              getImage()        Returns the current record's "image" value
 * @method string              getDescription()  Returns the current record's "description" value
 * @method integer             getPhone()        Returns the current record's "phone" value
 * @method timestamp           getCreatedAt()    Returns the current record's "created_at" value
 * @method timestamp           getLastSeenAt()   Returns the current record's "last_seen_at" value
 * @method Organization        getOrganization() Returns the current record's "Organization" value
 * @method Doctrine_Collection getNews()         Returns the current record's "News" collection
 * @method User                setId()           Sets the current record's "id" value
 * @method User                setUsername()     Sets the current record's "username" value
 * @method User                setLastname()     Sets the current record's "lastname" value
 * @method User                setFirstname()    Sets the current record's "firstname" value
 * @method User                setType()         Sets the current record's "type" value
 * @method User                setRole()         Sets the current record's "role" value
 * @method User                setOrgId()        Sets the current record's "org_id" value
 * @method User                setPassRd()       Sets the current record's "pass_rd" value
 * @method User                setIsActive()     Sets the current record's "is_active" value
 * @method User                setIsClose()      Sets the current record's "is_close" value
 * @method User                setPassword()     Sets the current record's "password" value
 * @method User                setEmail()        Sets the current record's "email" value
 * @method User                setGender()       Sets the current record's "gender" value
 * @method User                setBirthday()     Sets the current record's "birthday" value
 * @method User                setImage()        Sets the current record's "image" value
 * @method User                setDescription()  Sets the current record's "description" value
 * @method User                setPhone()        Sets the current record's "phone" value
 * @method User                setCreatedAt()    Sets the current record's "created_at" value
 * @method User                setLastSeenAt()   Sets the current record's "last_seen_at" value
 * @method User                setOrganization() Sets the current record's "Organization" value
 * @method User                setNews()         Sets the current record's "News" collection
 * 
 * @package    mongolcom
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseUser extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('user');
        $this->hasColumn('id', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'autoincrement' => true,
             'length' => 4,
             ));
        $this->hasColumn('username', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('lastname', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('firstname', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('type', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 4,
             ));
        $this->hasColumn('role', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 4,
             ));
        $this->hasColumn('org_id', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 4,
             ));
        $this->hasColumn('pass_rd', 'string', 10, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 10,
             ));
        $this->hasColumn('is_active', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 4,
             ));
        $this->hasColumn('is_close', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 4,
             ));
        $this->hasColumn('password', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('email', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('gender', 'integer', 1, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 1,
             ));
        $this->hasColumn('birthday', 'date', 25, array(
             'type' => 'date',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 25,
             ));
        $this->hasColumn('image', 'string', 255, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 255,
             ));
        $this->hasColumn('description', 'string', null, array(
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => '',
             ));
        $this->hasColumn('phone', 'integer', 4, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => false,
             'autoincrement' => false,
             'length' => 4,
             ));
        $this->hasColumn('created_at', 'timestamp', 25, array(
             'type' => 'timestamp',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 25,
             ));
        $this->hasColumn('last_seen_at', 'timestamp', 25, array(
             'type' => 'timestamp',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             'length' => 25,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('Organization', array(
             'local' => 'org_id',
             'foreign' => 'id'));

        $this->hasMany('News', array(
             'local' => 'id',
             'foreign' => 'created_by'));
    }
}