function deleteAction() { /* This is from profilegateways $id = AF::get($_POST, 'id', 0); $ids = explode('_', $id); $errors = FALSE; $model = new ProfileGateway(); $model->profile_id = $ids[0]; $model->method_id = $ids[1]; $model->gateway_id = $ids[2]; $model->delete(); unset($model); Message::echoJsonSuccess(__('gateway_removed')); $this->redirect(); */ $id = AF::get($_POST, 'id', 0); $errors = FALSE; $model = new GatewayLimit(); $model->model_uset_id = $this->user->user_id; if ($model->findByPk($id)) { $model->delete(); } else { $errors = TRUE; } if ($model->getErrors()) { $errors = TRUE; } unset($model); Message::echoJsonSuccess(__('limit_removed')); $this->redirect(); }