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

/**
 * BaseTS_IM
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property string $codigo
 * @property string $descripcion
 * @property string $desccorta
 * @property string $base
 * @property string $porcentaje
 * @property string $operador
 * @property integer $id_tercero
 * @property integer $id_ts_cr
 * @property integer $id_ts_ae
 * @property integer $indep
 * @property string $codsiif
 * @property integer $cruce
 * @property integer $id_agrup_reten
 * @property integer $cambiar_base
 * @property TS_AGRUP_CIIU $TS_AGRUP_CIIU
 * @property TS_CR $TS_CR
 * @property Doctrine_Collection $TS_CP
 * @property Doctrine_Collection $TS_CP_3
 * @property Doctrine_Collection $TS_CP_4
 * 
 * @method integer             getId()             Returns the current record's "id" value
 * @method string              getCodigo()         Returns the current record's "codigo" value
 * @method string              getDescripcion()    Returns the current record's "descripcion" value
 * @method string              getDesccorta()      Returns the current record's "desccorta" value
 * @method string              getBase()           Returns the current record's "base" value
 * @method string              getPorcentaje()     Returns the current record's "porcentaje" value
 * @method string              getOperador()       Returns the current record's "operador" value
 * @method integer             getIdTercero()      Returns the current record's "id_tercero" value
 * @method integer             getIdTsCr()         Returns the current record's "id_ts_cr" value
 * @method integer             getIdTsAe()         Returns the current record's "id_ts_ae" value
 * @method integer             getIndep()          Returns the current record's "indep" value
 * @method string              getCodsiif()        Returns the current record's "codsiif" value
 * @method integer             getCruce()          Returns the current record's "cruce" value
 * @method integer             getIdAgrupReten()   Returns the current record's "id_agrup_reten" value
 * @method integer             getCambiarBase()    Returns the current record's "cambiar_base" value
 * @method TS_AGRUP_CIIU       getTSAGRUPCIIU()    Returns the current record's "TS_AGRUP_CIIU" value
 * @method TS_CR               getTSCR()           Returns the current record's "TS_CR" value
 * @method Doctrine_Collection getTSCP()           Returns the current record's "TS_CP" collection
 * @method Doctrine_Collection getTSCP3()          Returns the current record's "TS_CP_3" collection
 * @method Doctrine_Collection getTSCP4()          Returns the current record's "TS_CP_4" collection
 * @method TS_IM               setId()             Sets the current record's "id" value
 * @method TS_IM               setCodigo()         Sets the current record's "codigo" value
 * @method TS_IM               setDescripcion()    Sets the current record's "descripcion" value
 * @method TS_IM               setDesccorta()      Sets the current record's "desccorta" value
 * @method TS_IM               setBase()           Sets the current record's "base" value
 * @method TS_IM               setPorcentaje()     Sets the current record's "porcentaje" value
 * @method TS_IM               setOperador()       Sets the current record's "operador" value
 * @method TS_IM               setIdTercero()      Sets the current record's "id_tercero" value
 * @method TS_IM               setIdTsCr()         Sets the current record's "id_ts_cr" value
 * @method TS_IM               setIdTsAe()         Sets the current record's "id_ts_ae" value
 * @method TS_IM               setIndep()          Sets the current record's "indep" value
 * @method TS_IM               setCodsiif()        Sets the current record's "codsiif" value
 * @method TS_IM               setCruce()          Sets the current record's "cruce" value
 * @method TS_IM               setIdAgrupReten()   Sets the current record's "id_agrup_reten" value
 * @method TS_IM               setCambiarBase()    Sets the current record's "cambiar_base" value
 * @method TS_IM               setTSAGRUPCIIU()    Sets the current record's "TS_AGRUP_CIIU" value
 * @method TS_IM               setTSCR()           Sets the current record's "TS_CR" value
 * @method TS_IM               setTSCP()           Sets the current record's "TS_CP" collection
 * @method TS_IM               setTSCP3()          Sets the current record's "TS_CP_3" collection
 * @method TS_IM               setTSCP4()          Sets the current record's "TS_CP_4" collection
 * 
 * @package    cobro_coactivo
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7691 2011-02-04 15:43:29Z jwage $
 */
abstract class BaseTS_IM extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('TS_IM');
        $this->hasColumn('id', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'length' => 20,
             ));
        $this->hasColumn('codigo', 'string', 20, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('descripcion', 'string', 1000, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 1000,
             ));
        $this->hasColumn('desccorta', 'string', 100, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 100,
             ));
        $this->hasColumn('base', 'string', 20, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('porcentaje', 'string', 20, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('operador', 'string', 1, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 1,
             ));
        $this->hasColumn('id_tercero', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_ts_cr', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_ts_ae', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('indep', 'integer', 1, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 1,
             ));
        $this->hasColumn('codsiif', 'string', 20, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('cruce', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_agrup_reten', 'integer', 20, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('cambiar_base', 'integer', 1, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'default' => '0 ',
             'primary' => false,
             'length' => 1,
             ));
    }

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

        $this->hasOne('TS_CR', array(
             'local' => 'id_ts_cr',
             'foreign' => 'id'));

        $this->hasMany('TS_CP', array(
             'local' => 'id',
             'foreign' => 'id_im_retefuente'));

        $this->hasMany('TS_CP as TS_CP_3', array(
             'local' => 'id',
             'foreign' => 'id_im_reteiva'));

        $this->hasMany('TS_CP as TS_CP_4', array(
             'local' => 'id',
             'foreign' => 'id_im_reteica'));
    }
}