/** * Deletes an existing Services model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $model = $this->findModel($id); Services::updateAll(['parent_id' => $model->parent_id], 'parent_id=:parent_id', [':parent_id' => $model->id]); $model->delete(); return $this->redirect(['index']); }