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

/**
 * BaseCA_CREDITO
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id_credito
 * @property integer $id_anhos
 * @property integer $id_punto_venta
 * @property integer $id_tipo_credito
 * @property integer $sec_credito
 * @property integer $id_con_credito
 * @property timestamp $fecha_proceso
 * @property integer $id_bn
 * @property integer $id_cb
 * @property integer $num_doc
 * @property string $oficina
 * @property decimal $valor
 * @property string $observaciones
 * @property integer $estado
 * @property timestamp $fecha_anu
 * @property string $motivo_anu
 * @property timestamp $fecha
 * @property integer $id_ts_td
 * @property string $usuariolog
 * @property integer $id_mae_ter
 * @property CA_CON_CREDITO $CA_CON_CREDITO
 * @property CA_PUNTO_VENTA $CA_PUNTO_VENTA
 * @property CA_TIPO_CREDITO $CA_TIPO_CREDITO
 * @property INTERCEROS $INTERCEROS
 * @property TS_BN $TS_BN
 * @property TS_CB $TS_CB
 * @property TS_TD $TS_TD
 * @property Doctrine_Collection $CA_EXCEDENTES
 * @property Doctrine_Collection $CA_EXCEDENTES_2
 * @property Doctrine_Collection $CA_CREDITO_DETALLE
 * 
 * @method integer             getIdCredito()          Returns the current record's "id_credito" value
 * @method integer             getIdAnhos()            Returns the current record's "id_anhos" value
 * @method integer             getIdPuntoVenta()       Returns the current record's "id_punto_venta" value
 * @method integer             getIdTipoCredito()      Returns the current record's "id_tipo_credito" value
 * @method integer             getSecCredito()         Returns the current record's "sec_credito" value
 * @method integer             getIdConCredito()       Returns the current record's "id_con_credito" value
 * @method timestamp           getFechaProceso()       Returns the current record's "fecha_proceso" value
 * @method integer             getIdBn()               Returns the current record's "id_bn" value
 * @method integer             getIdCb()               Returns the current record's "id_cb" value
 * @method integer             getNumDoc()             Returns the current record's "num_doc" value
 * @method string              getOficina()            Returns the current record's "oficina" value
 * @method decimal             getValor()              Returns the current record's "valor" value
 * @method string              getObservaciones()      Returns the current record's "observaciones" value
 * @method integer             getEstado()             Returns the current record's "estado" value
 * @method timestamp           getFechaAnu()           Returns the current record's "fecha_anu" value
 * @method string              getMotivoAnu()          Returns the current record's "motivo_anu" value
 * @method timestamp           getFecha()              Returns the current record's "fecha" value
 * @method integer             getIdTsTd()             Returns the current record's "id_ts_td" value
 * @method string              getUsuariolog()         Returns the current record's "usuariolog" value
 * @method integer             getIdMaeTer()           Returns the current record's "id_mae_ter" value
 * @method CA_CON_CREDITO      getCACONCREDITO()       Returns the current record's "CA_CON_CREDITO" value
 * @method CA_PUNTO_VENTA      getCAPUNTOVENTA()       Returns the current record's "CA_PUNTO_VENTA" value
 * @method CA_TIPO_CREDITO     getCATIPOCREDITO()      Returns the current record's "CA_TIPO_CREDITO" value
 * @method INTERCEROS          getINTERCEROS()         Returns the current record's "INTERCEROS" value
 * @method TS_BN               getTSBN()               Returns the current record's "TS_BN" value
 * @method TS_CB               getTSCB()               Returns the current record's "TS_CB" value
 * @method TS_TD               getTSTD()               Returns the current record's "TS_TD" value
 * @method Doctrine_Collection getCAEXCEDENTES()       Returns the current record's "CA_EXCEDENTES" collection
 * @method Doctrine_Collection getCAEXCEDENTES2()      Returns the current record's "CA_EXCEDENTES_2" collection
 * @method Doctrine_Collection getCACREDITODETALLE()   Returns the current record's "CA_CREDITO_DETALLE" collection
 * @method CA_CREDITO          setIdCredito()          Sets the current record's "id_credito" value
 * @method CA_CREDITO          setIdAnhos()            Sets the current record's "id_anhos" value
 * @method CA_CREDITO          setIdPuntoVenta()       Sets the current record's "id_punto_venta" value
 * @method CA_CREDITO          setIdTipoCredito()      Sets the current record's "id_tipo_credito" value
 * @method CA_CREDITO          setSecCredito()         Sets the current record's "sec_credito" value
 * @method CA_CREDITO          setIdConCredito()       Sets the current record's "id_con_credito" value
 * @method CA_CREDITO          setFechaProceso()       Sets the current record's "fecha_proceso" value
 * @method CA_CREDITO          setIdBn()               Sets the current record's "id_bn" value
 * @method CA_CREDITO          setIdCb()               Sets the current record's "id_cb" value
 * @method CA_CREDITO          setNumDoc()             Sets the current record's "num_doc" value
 * @method CA_CREDITO          setOficina()            Sets the current record's "oficina" value
 * @method CA_CREDITO          setValor()              Sets the current record's "valor" value
 * @method CA_CREDITO          setObservaciones()      Sets the current record's "observaciones" value
 * @method CA_CREDITO          setEstado()             Sets the current record's "estado" value
 * @method CA_CREDITO          setFechaAnu()           Sets the current record's "fecha_anu" value
 * @method CA_CREDITO          setMotivoAnu()          Sets the current record's "motivo_anu" value
 * @method CA_CREDITO          setFecha()              Sets the current record's "fecha" value
 * @method CA_CREDITO          setIdTsTd()             Sets the current record's "id_ts_td" value
 * @method CA_CREDITO          setUsuariolog()         Sets the current record's "usuariolog" value
 * @method CA_CREDITO          setIdMaeTer()           Sets the current record's "id_mae_ter" value
 * @method CA_CREDITO          setCACONCREDITO()       Sets the current record's "CA_CON_CREDITO" value
 * @method CA_CREDITO          setCAPUNTOVENTA()       Sets the current record's "CA_PUNTO_VENTA" value
 * @method CA_CREDITO          setCATIPOCREDITO()      Sets the current record's "CA_TIPO_CREDITO" value
 * @method CA_CREDITO          setINTERCEROS()         Sets the current record's "INTERCEROS" value
 * @method CA_CREDITO          setTSBN()               Sets the current record's "TS_BN" value
 * @method CA_CREDITO          setTSCB()               Sets the current record's "TS_CB" value
 * @method CA_CREDITO          setTSTD()               Sets the current record's "TS_TD" value
 * @method CA_CREDITO          setCAEXCEDENTES()       Sets the current record's "CA_EXCEDENTES" collection
 * @method CA_CREDITO          setCAEXCEDENTES2()      Sets the current record's "CA_EXCEDENTES_2" collection
 * @method CA_CREDITO          setCACREDITODETALLE()   Sets the current record's "CA_CREDITO_DETALLE" collection
 * 
 * @package    nomina
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7691 2011-02-04 15:43:29Z jwage $
 */
abstract class BaseCA_CREDITO extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('CA_CREDITO');
        $this->hasColumn('id_credito', 'integer', 20, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'length' => 20,
             ));
        $this->hasColumn('id_anhos', 'integer', 20, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_punto_venta', 'integer', 20, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_tipo_credito', 'integer', 20, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('sec_credito', 'integer', 20, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_con_credito', 'integer', 20, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('fecha_proceso', 'timestamp', 7, array(
             'notnull' => true,
             'type' => 'timestamp',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 7,
             ));
        $this->hasColumn('id_bn', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_cb', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('num_doc', 'integer', 20, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('oficina', 'string', 45, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 45,
             ));
        $this->hasColumn('valor', 'decimal', 18, array(
             'notnull' => true,
             'type' => 'decimal',
             'fixed' => 0,
             'unsigned' => false,
             'default' => '0',
             'primary' => false,
             'length' => 18,
             ));
        $this->hasColumn('observaciones', 'string', 256, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 256,
             ));
        $this->hasColumn('estado', 'integer', 8, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'default' => '1',
             'primary' => false,
             'length' => 8,
             ));
        $this->hasColumn('fecha_anu', 'timestamp', 7, array(
             'notnull' => false,
             'type' => 'timestamp',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 7,
             ));
        $this->hasColumn('motivo_anu', 'string', 256, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 256,
             ));
        $this->hasColumn('fecha', 'timestamp', 7, array(
             'notnull' => true,
             'type' => 'timestamp',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 7,
             ));
        $this->hasColumn('id_ts_td', 'integer', 8, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
        $this->hasColumn('usuariolog', 'string', 20, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_mae_ter', 'integer', 8, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasOne('CA_CON_CREDITO', array(
             'local' => 'id_con_credito',
             'foreign' => 'id_con_credito'));

        $this->hasOne('CA_PUNTO_VENTA', array(
             'local' => 'id_punto_venta',
             'foreign' => 'id_punto_venta'));

        $this->hasOne('CA_TIPO_CREDITO', array(
             'local' => 'id_tipo_credito',
             'foreign' => 'id_tipo_credito'));

        $this->hasOne('INTERCEROS', array(
             'local' => 'id_mae_ter',
             'foreign' => 'id_mae_ter'));

        $this->hasOne('TS_BN', array(
             'local' => 'id_bn',
             'foreign' => 'id_bn'));

        $this->hasOne('TS_CB', array(
             'local' => 'id_cb',
             'foreign' => 'id_cb'));

        $this->hasOne('TS_TD', array(
             'local' => 'id_ts_td',
             'foreign' => 'id'));

        $this->hasMany('CA_EXCEDENTES', array(
             'local' => 'id_credito',
             'foreign' => 'id_credito'));

        $this->hasMany('CA_EXCEDENTES as CA_EXCEDENTES_2', array(
             'local' => 'id_credito',
             'foreign' => 'id_credito_aplicado'));

        $this->hasMany('CA_CREDITO_DETALLE', array(
             'local' => 'id_credito',
             'foreign' => 'id_credito'));
    }
}