public function updateAction() { $model_authors = new Application_Model_Authors(); if (isset($this->_request->id_author)) { if ($model_authors->check_if_exists("id_author", $this->_request->id_author)) { $model_app = new Application_Model_App(); $model_app->get_input_stream(); if (!$model_app->validate_author()) { http_response_code(400); echo "Invalid input. Use max 255 alphanumeric characters"; die; } $where = $model_authors->getAdapter()->quoteInto('id_author = ?', $this->_request->id_author); $model_authors->update($model_app->input, $where); http_response_code(201); echo "Update ok"; } else { http_response_code(400); echo "Bad id given"; } } else { http_response_code(400); echo "No id given"; } }