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