/** * Aligns the given group selection with the db * @return boolean */ public function save() { $group = $this->getGroup(); if ($group == null) { throw new \yii\web\HttpException(404, Yii::t('AdminModule.models_form_AddGroupMemberForm', 'Group not found!')); } $userGuids = explode(",", $this->userGuids); foreach ($userGuids as $userGuid) { $user = User::findIdentityByAccessToken($userGuid); if ($user != null) { $group->addUser($user); } } return true; }