예제 #1
0
 public function actionUpdateDirections()
 {
     $directionsArray = Yii::$app->request->post('directions');
     $currentPsychologistId = Yii::$app->user->id;
     $psychologistDirections = new PsychologistDirections();
     if ($psychologistDirections->setNewPsychologistDirections($currentPsychologistId, $directionsArray)) {
         return $this->redirect('index');
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
예제 #2
0
 private function deletePsychologistDirections($psychologistId)
 {
     return PsychologistDirections::deleteAll('psychologist_id = ' . $psychologistId);
 }
예제 #3
0
 /**
  * Deletes an existing Directions 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();
     PsychologistDirections::deleteAll(['direction_id' => $id]);
     return $this->redirect(['index']);
 }