static function deleteCategoria($categoriaId) { $categoria = BaseDao::getCategoriaById($categoriaId); $result = new Result(); try { $transaction = GenericDao::beginTransaction(); $categoria->deleted = true; BaseDao::updateCategoria($categoria, $transaction); $transaction->commit(); } catch (\Exception $ex) { $transaction->rollBack(); $result->hasErrors = true; $result->messages = array($ex->getMessage()); } $response = new Response($result, NULL); return json_encode($response); }