<?php

/**
 * BaseUser
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property integer $manager_id
 * @property integer $city_id
 * @property string $username
 * @property string $fname
 * @property string $iname
 * @property string $oname
 * @property string $organization
 * @property string $city
 * @property string $inner_id
 * @property string $client_code
 * @property string $address
 * @property string $phone_number
 * @property string $email
 * @property string $limit_by_sum
 * @property string $current_discount
 * @property string $current_debt
 * @property string $orders_sum_last_month
 * @property string $orders_sum_current
 * @property string $salt
 * @property string $password
 * @property string $open_password
 * @property integer $manifest_version
 * @property string $cat_indx
 * @property string $cats_with_images
 * @property string $recovery_secret
 * @property boolean $is_active
 * @property boolean $is_super_admin
 * @property timestamp $last_login
 * @property User $Manager
 * @property Doctrine_Collection $User
 * 
 * @method integer             getId()                    Returns the current record's "id" value
 * @method integer             getManagerId()             Returns the current record's "manager_id" value
 * @method integer             getCityId()                Returns the current record's "city_id" value
 * @method string              getUsername()              Returns the current record's "username" value
 * @method string              getFname()                 Returns the current record's "fname" value
 * @method string              getIname()                 Returns the current record's "iname" value
 * @method string              getOname()                 Returns the current record's "oname" value
 * @method string              getOrganization()          Returns the current record's "organization" value
 * @method string              getCity()                  Returns the current record's "city" value
 * @method string              getInnerId()               Returns the current record's "inner_id" value
 * @method string              getClientCode()            Returns the current record's "client_code" value
 * @method string              getAddress()               Returns the current record's "address" value
 * @method string              getPhoneNumber()           Returns the current record's "phone_number" value
 * @method string              getEmail()                 Returns the current record's "email" value
 * @method string              getLimitBySum()            Returns the current record's "limit_by_sum" value
 * @method string              getCurrentDiscount()       Returns the current record's "current_discount" value
 * @method string              getCurrentDebt()           Returns the current record's "current_debt" value
 * @method string              getOrdersSumLastMonth()    Returns the current record's "orders_sum_last_month" value
 * @method string              getOrdersSumCurrent()      Returns the current record's "orders_sum_current" value
 * @method string              getSalt()                  Returns the current record's "salt" value
 * @method string              getPassword()              Returns the current record's "password" value
 * @method string              getOpenPassword()          Returns the current record's "open_password" value
 * @method integer             getManifestVersion()       Returns the current record's "manifest_version" value
 * @method string              getCatIndx()               Returns the current record's "cat_indx" value
 * @method string              getCatsWithImages()        Returns the current record's "cats_with_images" value
 * @method string              getRecoverySecret()        Returns the current record's "recovery_secret" value
 * @method boolean             getIsActive()              Returns the current record's "is_active" value
 * @method boolean             getIsSuperAdmin()          Returns the current record's "is_super_admin" value
 * @method timestamp           getLastLogin()             Returns the current record's "last_login" value
 * @method User                getManager()               Returns the current record's "Manager" value
 * @method Doctrine_Collection getUser()                  Returns the current record's "User" collection
 * @method User                setId()                    Sets the current record's "id" value
 * @method User                setManagerId()             Sets the current record's "manager_id" value
 * @method User                setCityId()                Sets the current record's "city_id" value
 * @method User                setUsername()              Sets the current record's "username" value
 * @method User                setFname()                 Sets the current record's "fname" value
 * @method User                setIname()                 Sets the current record's "iname" value
 * @method User                setOname()                 Sets the current record's "oname" value
 * @method User                setOrganization()          Sets the current record's "organization" value
 * @method User                setCity()                  Sets the current record's "city" value
 * @method User                setInnerId()               Sets the current record's "inner_id" value
 * @method User                setClientCode()            Sets the current record's "client_code" value
 * @method User                setAddress()               Sets the current record's "address" value
 * @method User                setPhoneNumber()           Sets the current record's "phone_number" value
 * @method User                setEmail()                 Sets the current record's "email" value
 * @method User                setLimitBySum()            Sets the current record's "limit_by_sum" value
 * @method User                setCurrentDiscount()       Sets the current record's "current_discount" value
 * @method User                setCurrentDebt()           Sets the current record's "current_debt" value
 * @method User                setOrdersSumLastMonth()    Sets the current record's "orders_sum_last_month" value
 * @method User                setOrdersSumCurrent()      Sets the current record's "orders_sum_current" value
 * @method User                setSalt()                  Sets the current record's "salt" value
 * @method User                setPassword()              Sets the current record's "password" value
 * @method User                setOpenPassword()          Sets the current record's "open_password" value
 * @method User                setManifestVersion()       Sets the current record's "manifest_version" value
 * @method User                setCatIndx()               Sets the current record's "cat_indx" value
 * @method User                setCatsWithImages()        Sets the current record's "cats_with_images" value
 * @method User                setRecoverySecret()        Sets the current record's "recovery_secret" value
 * @method User                setIsActive()              Sets the current record's "is_active" value
 * @method User                setIsSuperAdmin()          Sets the current record's "is_super_admin" value
 * @method User                setLastLogin()             Sets the current record's "last_login" value
 * @method User                setManager()               Sets the current record's "Manager" value
 * @method User                setUser()                  Sets the current record's "User" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @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', null, array(
             'type' => 'integer',
             'primary' => true,
             'autoincrement' => true,
             ));
        $this->hasColumn('manager_id', 'integer', null, array(
             'type' => 'integer',
             ));
        $this->hasColumn('city_id', 'integer', 10, array(
             'type' => 'integer',
             'length' => 10,
             ));
        $this->hasColumn('username', 'string', 128, array(
             'type' => 'string',
             'notnull' => true,
             'unique' => true,
             'length' => 128,
             ));
        $this->hasColumn('fname', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('iname', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('oname', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('organization', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('city', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('inner_id', 'string', 50, array(
             'type' => 'string',
             'length' => 50,
             ));
        $this->hasColumn('client_code', 'string', 20, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 20,
             ));
        $this->hasColumn('address', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('phone_number', 'string', 100, array(
             'type' => 'string',
             'length' => 100,
             ));
        $this->hasColumn('email', 'string', 128, array(
             'type' => 'string',
             'notnull' => false,
             'length' => 128,
             ));
        $this->hasColumn('limit_by_sum', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('current_discount', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('current_debt', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('orders_sum_last_month', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('orders_sum_current', 'string', 40, array(
             'type' => 'string',
             'length' => 40,
             ));
        $this->hasColumn('salt', 'string', 128, array(
             'type' => 'string',
             'length' => 128,
             ));
        $this->hasColumn('password', 'string', 128, array(
             'type' => 'string',
             'length' => 128,
             ));
        $this->hasColumn('open_password', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
        $this->hasColumn('manifest_version', 'integer', null, array(
             'type' => 'integer',
             'default' => 0,
             ));
        $this->hasColumn('cat_indx', 'string', 10000, array(
             'type' => 'string',
             'length' => 10000,
             ));
        $this->hasColumn('cats_with_images', 'string', 10000, array(
             'type' => 'string',
             'length' => 10000,
             ));
        $this->hasColumn('recovery_secret', 'string', 10000, array(
             'type' => 'string',
             'length' => 10000,
             ));
        $this->hasColumn('is_active', 'boolean', null, array(
             'type' => 'boolean',
             'default' => 0,
             ));
        $this->hasColumn('is_super_admin', 'boolean', null, array(
             'type' => 'boolean',
             'default' => false,
             ));
        $this->hasColumn('last_login', 'timestamp', null, array(
             'type' => 'timestamp',
             ));


        $this->index('name_idx', array(
             'fields' => 
             array(
              0 => 'username',
             ),
             'unique' => true,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('User as Manager', array(
             'local' => 'manager_id',
             'foreign' => 'id'));

        $this->hasMany('User', array(
             'local' => 'id',
             'foreign' => 'manager_id'));

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