public function ajaxDeletarTagAction() { if (!$this->autenticacao(true)) { return; } $model = new Application_Model_EventoTags(); try { $id = $this->_getParam('id', 0); $id_evento = $this->_getParam('id_evento', 0); $where = $model->getAdapter()->quoteInto("id_tag = ?", $id); $where .= $model->getAdapter()->quoteInto("AND id_evento = ?", $id_evento); $affected = $model->delete($where); if ($affected > 0) { $this->view->ok = true; $this->view->msg = _("Tag removed successfully."); } else { $this->view->error = _("Tag not found."); $this->view->ok = false; } } catch (Exception $e) { $this->view->error = _("An unexpected error ocurred while saving <b>tag</b>. Details: ") . $e->getMessage(); $this->view->ok = false; } }