<?php

class Sistema_Model_TipoVistoria extends Agro_Db_Table_Abstract {
    const PREVIA = 1;
    const PRELIMINAR = 2;
    const FINAL = 3;

	public $_order = array('ds_chave_tipos_vistoria');
	protected $_schema = 'sistema';
	protected $_name = 'tipos_vistoria';
	protected $_primary = 'id';

	public function getIdbyChave($dsChave) {
		$select = $this->select();
		$select->setIntegrityCheck(false);
		$select->from(array('tv'=>'sistema.tipos_vistoria'), 'tv.id');
		$select->where('tv.ds_chave_tipos_vistoria = ?', $dsChave);

		return $this->getAdapter()->fetchOne($select);
	}

}
