private function atualizaStatus() { $modelProposta = new Model_DbTable_Proposta(); $where = "proposta_status = 'Aguardando resposta'"; $propostas = $modelProposta->fetchAll($where); $zendDateNow = new Zend_Date(); foreach ($propostas as $proposta) { $zendDateVencimento = new Zend_Date($proposta->proposta_vencimento); if ($zendDateVencimento->isEarlier($zendDateNow)) { // atualiza o status $update = array('proposta_status' => self::STATUS_VENCIDA); try { $modelProposta->updateById($update, $proposta->proposta_id); } catch (Exception $ex) { continue; } } } }