<?php
// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('CA_USUARIO', 'doctrine');

/**
 * BaseCA_USUARIO
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id_usuario
 * @property string $username
 * @property string $password
 * @property integer $estado
 * @property Doctrine_Collection $CA_USUARIO_PERFIL
 * @property Doctrine_Collection $CA_USUARIO_COMPETENCIA
 * @property Doctrine_Collection $CA_RECIBO
 * @property Doctrine_Collection $CA_PREG_SEGURIDAD
 * @property Doctrine_Collection $CA_LOG
 * @property Doctrine_Collection $CA_LIQ_CANON
 * @property Doctrine_Collection $CA_LIQ_CANON_3
 * @property Doctrine_Collection $CA_DET_LIQ_CANON
 * @property Doctrine_Collection $CA_DET_LIQ_CANON_9
 * @property Doctrine_Collection $CA_DET_LIQ_CANON_8
 * 
 * @method integer             getIdUsuario()              Returns the current record's "id_usuario" value
 * @method string              getUsername()               Returns the current record's "username" value
 * @method string              getPassword()               Returns the current record's "password" value
 * @method integer             getEstado()                 Returns the current record's "estado" value
 * @method Doctrine_Collection getCAUSUARIOPERFIL()        Returns the current record's "CA_USUARIO_PERFIL" collection
 * @method Doctrine_Collection getCAUSUARIOCOMPETENCIA()   Returns the current record's "CA_USUARIO_COMPETENCIA" collection
 * @method Doctrine_Collection getCARECIBO()               Returns the current record's "CA_RECIBO" collection
 * @method Doctrine_Collection getCAPREGSEGURIDAD()        Returns the current record's "CA_PREG_SEGURIDAD" collection
 * @method Doctrine_Collection getCALOG()                  Returns the current record's "CA_LOG" collection
 * @method Doctrine_Collection getCALIQCANON()             Returns the current record's "CA_LIQ_CANON" collection
 * @method Doctrine_Collection getCALIQCANON3()            Returns the current record's "CA_LIQ_CANON_3" collection
 * @method Doctrine_Collection getCADETLIQCANON()          Returns the current record's "CA_DET_LIQ_CANON" collection
 * @method Doctrine_Collection getCADETLIQCANON9()         Returns the current record's "CA_DET_LIQ_CANON_9" collection
 * @method Doctrine_Collection getCADETLIQCANON8()         Returns the current record's "CA_DET_LIQ_CANON_8" collection
 * @method CA_USUARIO          setIdUsuario()              Sets the current record's "id_usuario" value
 * @method CA_USUARIO          setUsername()               Sets the current record's "username" value
 * @method CA_USUARIO          setPassword()               Sets the current record's "password" value
 * @method CA_USUARIO          setEstado()                 Sets the current record's "estado" value
 * @method CA_USUARIO          setCAUSUARIOPERFIL()        Sets the current record's "CA_USUARIO_PERFIL" collection
 * @method CA_USUARIO          setCAUSUARIOCOMPETENCIA()   Sets the current record's "CA_USUARIO_COMPETENCIA" collection
 * @method CA_USUARIO          setCARECIBO()               Sets the current record's "CA_RECIBO" collection
 * @method CA_USUARIO          setCAPREGSEGURIDAD()        Sets the current record's "CA_PREG_SEGURIDAD" collection
 * @method CA_USUARIO          setCALOG()                  Sets the current record's "CA_LOG" collection
 * @method CA_USUARIO          setCALIQCANON()             Sets the current record's "CA_LIQ_CANON" collection
 * @method CA_USUARIO          setCALIQCANON3()            Sets the current record's "CA_LIQ_CANON_3" collection
 * @method CA_USUARIO          setCADETLIQCANON()          Sets the current record's "CA_DET_LIQ_CANON" collection
 * @method CA_USUARIO          setCADETLIQCANON9()         Sets the current record's "CA_DET_LIQ_CANON_9" collection
 * @method CA_USUARIO          setCADETLIQCANON8()         Sets the current record's "CA_DET_LIQ_CANON_8" collection
 * 
 * @package    canon
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7691 2011-02-04 15:43:29Z jwage $
 */
abstract class BaseCA_USUARIO extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('CA_USUARIO');
        $this->hasColumn('id_usuario', 'integer', 8, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'length' => 8,
             ));
        $this->hasColumn('username', 'string', 64, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 64,
             ));
        $this->hasColumn('password', 'string', 128, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 128,
             ));
        $this->hasColumn('estado', 'integer', 1, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 1,
             ));
        $this->hasColumn('email', 'string', 100, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 100,
             ));
        $this->hasColumn('documento', 'string', 20, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('nombre', 'string', 100, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 100,
             ));
        
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('CA_USUARIO_PERFIL', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario'));

        $this->hasMany('CA_USUARIO_COMPETENCIA', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario'));

        $this->hasMany('CA_RECIBO', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario_anula'));

        $this->hasMany('CA_PREG_SEGURIDAD', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario'));

        $this->hasMany('CA_LOG', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario'));

        $this->hasMany('CA_LIQ_CANON', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario_cierre'));

        $this->hasMany('CA_LIQ_CANON as CA_LIQ_CANON_3', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario_anula'));

        $this->hasMany('CA_DET_LIQ_CANON', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario_aprueba'));

        $this->hasMany('CA_DET_LIQ_CANON as CA_DET_LIQ_CANON_9', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario_anula'));

        $this->hasMany('CA_DET_LIQ_CANON as CA_DET_LIQ_CANON_8', array(
             'local' => 'id_usuario',
             'foreign' => 'id_usuario_anula'));
    }
}