<?
class Sinistro_Model_MotivoQuadraNaoVistoriada extends Agro_Db_Table_Abstract {
	public $_pairs = array('key' => 'id', 'field' => 'ds_motivo');
	protected $_schema = 'sinistro';
	protected $_name = 'motivos_quadra_nao_vistoriada';
	protected $_primary = 'id';
	public $_order = 'ds_motivo';

	const AREA_COLHIDA = 1;
	const SEGURADO_DISPENSA_VISTORIA = 2;
	const AREA_ERRADICADA = 3;
	const NAO_SEMEADURA = 4;
	const NAO_EMERGENCIA_PLANTAS = 5;
	const CONDICOES_CLIMATICAS_DESFAVORAVEIS = 6;
	const AREA_NAO_ATINGIDA = 7;
	const CULTURA_NAO_ESTA_MADURA = 8;
	const ITEM_CONSTA_EM_VISTORIA_ANTERIOR = 9;
	const NAO_REALIZADA_NESTA_VISTORIA = 10;
	const COORDENADAS_DIVERGENTES = 11;
	const DATA_COBERTURA_FORA_DO_PERIODO_COBERTURA = 12;
	const VISTORIA_FRUSTRADA = 13;

	/** @var Type $var description */
	protected $var = null;
	
	public function save(array $data) {
		try {
			$Row = $this->getRow($data['id']);
			$Row->ds_motivo = $data['ds_motivo'];
			
			return $Row->save();
			
		} catch (Exception $e) {
			$this->setMessage($e->getMessage());
			return false;
		}
	}	
}

