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

/**
 * BaseTS_GI
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property integer $id
 * @property string $codigo
 * @property string $descripcion
 * @property string $abrev
 * @property integer $id_pr_tipo_ingre
 * @property integer $id_pr_nume_ingre
 * @property string $rubro_siif
 * @property PR_NUME_INGRE $PR_NUME_INGRE
 * @property PR_TIPO_INGRE $PR_TIPO_INGRE
 * @property Doctrine_Collection $TS_PC_VRC
 * @property Doctrine_Collection $TS_PC_MRC
 * @property Doctrine_Collection $TS_MB
 * @property Doctrine_Collection $CA_PRODUCTO
 * 
 * @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              getAbrev()            Returns the current record's "abrev" value
 * @method integer             getIdPrTipoIngre()    Returns the current record's "id_pr_tipo_ingre" value
 * @method integer             getIdPrNumeIngre()    Returns the current record's "id_pr_nume_ingre" value
 * @method string              getRubroSiif()        Returns the current record's "rubro_siif" value
 * @method PR_NUME_INGRE       getPRNUMEINGRE()      Returns the current record's "PR_NUME_INGRE" value
 * @method PR_TIPO_INGRE       getPRTIPOINGRE()      Returns the current record's "PR_TIPO_INGRE" value
 * @method Doctrine_Collection getTSPCVRC()          Returns the current record's "TS_PC_VRC" collection
 * @method Doctrine_Collection getTSPCMRC()          Returns the current record's "TS_PC_MRC" collection
 * @method Doctrine_Collection getTSMB()             Returns the current record's "TS_MB" collection
 * @method Doctrine_Collection getCAPRODUCTO()       Returns the current record's "CA_PRODUCTO" collection
 * @method TS_GI               setId()               Sets the current record's "id" value
 * @method TS_GI               setCodigo()           Sets the current record's "codigo" value
 * @method TS_GI               setDescripcion()      Sets the current record's "descripcion" value
 * @method TS_GI               setAbrev()            Sets the current record's "abrev" value
 * @method TS_GI               setIdPrTipoIngre()    Sets the current record's "id_pr_tipo_ingre" value
 * @method TS_GI               setIdPrNumeIngre()    Sets the current record's "id_pr_nume_ingre" value
 * @method TS_GI               setRubroSiif()        Sets the current record's "rubro_siif" value
 * @method TS_GI               setPRNUMEINGRE()      Sets the current record's "PR_NUME_INGRE" value
 * @method TS_GI               setPRTIPOINGRE()      Sets the current record's "PR_TIPO_INGRE" value
 * @method TS_GI               setTSPCVRC()          Sets the current record's "TS_PC_VRC" collection
 * @method TS_GI               setTSPCMRC()          Sets the current record's "TS_PC_MRC" collection
 * @method TS_GI               setTSMB()             Sets the current record's "TS_MB" collection
 * @method TS_GI               setCAPRODUCTO()       Sets the current record's "CA_PRODUCTO" collection
 * 
 * @package    nomina
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7691 2011-02-04 15:43:29Z jwage $
 */
abstract class BaseTS_GI extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('TS_GI');
        $this->hasColumn('id', 'integer', 20, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'length' => 20,
             ));
        $this->hasColumn('codigo', 'string', 20, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('descripcion', 'string', 1000, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 1000,
             ));
        $this->hasColumn('abrev', 'string', 20, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        $this->hasColumn('id_pr_tipo_ingre', 'integer', 8, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
        $this->hasColumn('id_pr_nume_ingre', 'integer', 8, array(
             'notnull' => false,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
        $this->hasColumn('rubro_siif', 'string', 30, array(
             'notnull' => false,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 30,
             ));
    }

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

        $this->hasOne('PR_TIPO_INGRE', array(
             'local' => 'id_pr_tipo_ingre',
             'foreign' => 'id'));

        $this->hasMany('TS_PC_VRC', array(
             'local' => 'id',
             'foreign' => 'p_ingresos'));

        $this->hasMany('TS_PC_MRC', array(
             'local' => 'id',
             'foreign' => 'grupo'));

        $this->hasMany('TS_MB', array(
             'local' => 'id',
             'foreign' => 'grupo'));

        $this->hasMany('CA_PRODUCTO', array(
             'local' => 'id',
             'foreign' => 'id_grupo'));
    }
}