public static function FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
- 8.6 modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
- 8.7 modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
- 10.3.x modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
- 10.0.x modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
- 10.1.x modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
- 10.2.x modules/social_features/social_group/modules/social_group_flexible_group/src/FlexibleGroupContentVisibilityUpdate.php \Drupal\social_group_flexible_group\FlexibleGroupContentVisibilityUpdate::updateVisibilityFinishedCallback()
Callback for finished batch events.
Parameters
bool $success: TRUE if the update was fully succeeded.
array $results: Contains individual results per operation.
array $operations: Contains the unprocessed operations that failed or weren't touched yet.
File
- modules/
social_features/ social_group/ modules/ social_group_flexible_group/ src/ FlexibleGroupContentVisibilityUpdate.php, line 152
Class
- FlexibleGroupContentVisibilityUpdate
- Class FlexibleGroupContentVisibilityUpdate.
Namespace
Drupal\social_group_flexible_groupCode
public static function updateVisibilityFinishedCallback($success, array $results, array $operations) {
$messenger = \Drupal::messenger();
if ($success) {
// Here we could do something meaningful with the results.
// We just display the number of nodes we processed...
$messenger
->addStatus(t('Visibility of content item(s) updated.'));
}
else {
// An error occurred.
// $operations contains the operations that remained unprocessed.
$error_operation = reset($operations);
$messenger
->addError(t('An error occurred while processing @operation with arguments : @args', [
'@operation' => $error_operation[0],
'@args' => print_r($error_operation[0], TRUE),
]));
}
}