public function update($FORMDATA, $optionals = array()) { $PROCESSED_INPUT = $this->beforeUpdate($FORMDATA); try { if ($this->loadedModel->update($PROCESSED_INPUT)) { $this->loadObjectDataFields(); $this->afterUpdate(); if (isset($optionals["noAlert"]) && $optionals['noAlert']) { return true; } AlertMessage::display(array('type' => AlertMessage::SUCCESS, 'message' => 'Atualizado com sucesso', 'icon' => 'ls-ico-checkmark')); return true; } } catch (Exception $ex) { AlertMessage::display(array('type' => AlertMessage::ERROR, 'message' => $this->setLastError($ex) . " <br>SQL: " . $this->loadedModel->getLastSQL(), 'icon' => 'ls-ico-close')); SystemHelper::preventPopupResultClosing(); return false; } }