<?php

// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('NO_PERMISO_FUNC', 'doctrine');

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BaseNO_PERMISO_FUNC
 *
 * @author ManuelEnrique Paredes Lopez
 */
abstract class BaseNO_PERMISO_FUNC extends sfDoctrineRecord {

    public function setTableDefinition() {
        $this->setTableName('NO_PERMISO_FUNC');
        $this->hasColumn('id_no_permiso_func', 'integer', 20, array(
            'type' => 'integer',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => true,
            'length' => 20,
        ));


        $this->hasColumn('id_tipo_doc', 'integer', 20, array(
            'notnull' => true,
            'type' => 'integer',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));

        $this->hasColumn('num_doc', 'string', 20, array(
            'notnull' => true,
            'type' => 'string',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));


        $this->hasColumn('id_periodo', 'integer', 20, array(
            'notnull' => true,
            'type' => 'integer',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));

        $this->hasColumn('fecha_permiso', 'timestamp', 7, array(
            'notnull' => true,
            'type' => 'timestamp',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 7,
        ));


        $this->hasColumn('hora_sol_inicio', 'string', 20, array(
            'notnull' => true,
            'type' => 'string',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));


        $this->hasColumn('hora_sol_final', 'string', 20, array(
            'notnull' => true,
            'type' => 'string',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));


        $this->hasColumn('observacion', 'string', 2000, array(
            'notnull' => true,
            'type' => 'string',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 2000,
        ));

        $this->hasColumn('total_horas_permiso', 'decimal', 20, array(
            'notnull' => true,
            'type' => 'integer',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));

        $this->hasColumn('hora_retorno', 'string', 20, array(
            'notnull' => true,
            'type' => 'string',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 20,
        ));

        $this->hasColumn('negacion', 'integer', 1, array(
            'notnull' => true,
            'type' => 'integer',
            'fixed' => 0,
            'unsigned' => false,
            'primary' => false,
            'length' => 1,
        ));
    }

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

}
