public function SocialBlockUser::execute in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.2 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.3 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.4 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.5 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.6 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.7 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 8.8 modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 10.3.x modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 10.0.x modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 10.1.x modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
- 10.2.x modules/social_features/social_user/src/Plugin/Action/SocialBlockUser.php \Drupal\social_user\Plugin\Action\SocialBlockUser::execute()
Executes the plugin.
Overrides ExecutableInterface::execute
File
- modules/
social_features/ social_user/ src/ Plugin/ Action/ SocialBlockUser.php, line 21
Class
- SocialBlockUser
- Alternate action plugin that can block users.
Namespace
Drupal\social_user\Plugin\ActionCode
public function execute($account = NULL) {
// Skip blocking user if they are already blocked.
if ($account !== FALSE && $account
->isActive()) {
// For efficiency manually save the original account before applying any
// changes.
$account->original = clone $account;
$account
->block();
$account
->save();
}
}