<?php

class Atendimento_Model_Prioridade extends Agro_Db_Table_Abstract {
	protected $_schema = 'atendimento';
	protected $_name = 'prioridade';
	protected $_primary = 'id';
	public $_order = 'ds_chave';

	const BAIXA = 1;
	const NORMAL = 2;
	const ALTA = 3;

	public function save($data) {
		$Row = $this->getRow($data['id']);
		
		$Row->ds_chave = $data['ds_chave'];
		$Row->ds_descricao = $data['ds_descricao'];
		
		return $Row->save();
	}
	
	public function getIdPrioridade($chave) {
		$Row = $this->fetchRow("ds_chave = '$chave'");
		return $Row->id;
	}
}