Exemplo n.º 1
0
 public function actionUpdateProblems()
 {
     $problemsArray = Yii::$app->request->post('problems');
     $currentPsychologistId = Yii::$app->user->id;
     $psychologistProblems = new PsychologistProblems();
     if ($psychologistProblems->setNewPsychologistProblems($currentPsychologistId, $problemsArray)) {
         return $this->redirect('index');
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 2
0
 /**
  * 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']);
 }
Exemplo n.º 3
0
 private function deletePsychologistProblems($psychologistId)
 {
     return PsychologistProblems::deleteAll('psychologist_id = ' . $psychologistId);
 }