public function SocialTourController::toggleOnboarding in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8.2 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8.3 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8.4 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8.5 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8.6 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 8.8 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 10.3.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 10.0.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 10.1.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
- 10.2.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::toggleOnboarding()
Toggle onboarding.
Parameters
array $account: Array containing the account.
File
- modules/
custom/ social_tour/ src/ SocialTourController.php, line 125
Class
- SocialTourController
- Class SocialTourController.
Namespace
Drupal\social_tourCode
public function toggleOnboarding(array $account = NULL) {
// No user given, then current user.
$id = $this->currentUser
->id();
if ($account instanceof UserInterface) {
$id = $account
->id();
}
$new_value = TRUE;
if ($this->userData
->get('social_tour', $id, 'onboarding_disabled')) {
$new_value = FALSE;
}
// Save the value in the user_data.
$this
->setData($new_value);
}