<?php

Doctrine_Manager::getInstance()->bindComponent('NO_VALOR_PROMEDIO', 'doctrine');

/**
 * Description of BaseNO_VALOR_PROMEDIO
 *
 * @author ManuelEnriqueParedesLopez
 */
abstract class BaseNO_VALOR_PROMEDIO extends sfDoctrineRecord{
    public function setTableDefinition() {
        $this->setTableName('NO_VALOR_PROMEDIO');
        
        
         /*$this->hasColumn('id_valor_promedio', 'integer', 8, array(
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => true,
             'length' => 8,
             ));*/
         
         
         $this->hasColumn('id_tipo_doc', 'integer', 8, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
        $this->hasColumn('num_doc', 'integer', 20, array(
             'notnull' => true,
             'type' => 'string',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 20,
             ));
        
        
         $this->hasColumn('id_concep_nomina', 'integer', 8, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
        $this->hasColumn('id_periodo', 'integer', 8, array(
             'notnull' => true,
             'type' => 'integer',
             'fixed' => 0,
             'unsigned' => false,
             'primary' => false,
             'length' => 8,
             ));
        
        
        
         $this->hasColumn('valor_promedio', 'decimal', 20, array(
             'notnull' => true,
             'type' => 'decimal',
             'fixed' => 0,
             'unsigned' => false,
             'default' => '0',
             'primary' => false,
             'length' => 20,
             ));
        

    }
    
    public function setUp() {
        parent::setUp();
        
        
        $this->hasOne('DATOS_FUNCIONARIO', array(
             'local' => 'id_tipo_doc',
             'foreign' => 'id_tipo_doc'));
        
        
        $this->hasOne('NO_CONCEP_NOMINA', array(
             'local' => 'id_concep_nomina',
             'foreign' => 'id_concep_nomina'));
        
        $this->hasOne('NO_PERIODO', array(
             'local' => 'id_periodo',
             'foreign' => 'id_periodo'));
        
        
    }
    
    
    
    
}
