public function actionUpdateSettings() { $settingsArray = $directionsArray = Yii::$app->request->post('settings'); $currentPsychologistId = Yii::$app->user->id; $userModules = new UsersModules(); if ($userModules->setNewUserSettings($currentPsychologistId, $settingsArray)) { return $this->redirect('index'); } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function init() { $this->layout = 'client_layout'; $imagesModel = new Image(); $this->logo = $imagesModel->getProfilePhoto(); $profile = $this->findModel(Yii::$app->user->id); $this->first_name = $profile->firstname; $this->last_name = $profile->lastname; $this->userModules = UsersModules::getUsersModules(); parent::init(); // custom initialization code goes here }
private function deleteUserSettings($psychologistId) { return UsersModules::deleteAll('user_id = ' . $psychologistId); }