public static function deleteGroupAndContentFinishedCallback($success, $results, $operations) {
    // The 'success' parameter means no fatal PHP errors were detected. All
    // other error management should be handled using 'results'.
    if ($success) {
      $message = \Drupal::translation()->formatPlural(
        count($results),
        'One item deleted.', '@count items deleted.'
      );
      // Provide some feedback when its a success.
      drupal_set_message(t('Your group and all of its topics, events and posts have been deleted.'));
      // TODO: log to the database.
    }
    else {
      $message = t('There was an unexpected error.');
      drupal_set_message($message, 'error');
    }
    // Redirect the user back to their groups overview once the batch is done.
    return new RedirectResponse(Url::fromRoute('view.groups.page_user_groups')->setRouteParameter('user', \Drupal::currentUser()->id())->toString());
  }
public static function deleteGroupAndContentFinishedCallback($success, $results, $operations) {
    // The 'success' parameter means no fatal PHP errors were detected. All
    // other error management should be handled using 'results'.
    if ($success) {
      $message = \Drupal::translation()->formatPlural(
        count($results),
        'One item deleted.', '@count items deleted.'
      );
      // Provide some feedback when its a success.
      drupal_set_message(t('Your group and all of its topics, events and posts have been deleted.'));
      // TODO: log to the database.
    }
    else {
      $message = t('There was an unexpected error.');
      drupal_set_message($message, 'error');
    }
    // Redirect the user back to their groups overview once the batch is done.
    return new RedirectResponse(Url::fromRoute('view.groups.page_user_groups')->setRouteParameter('user', \Drupal::currentUser()->id())->toString());
  }
public static function deleteGroupAndContentFinishedCallback ( $ success , $ results , $ operations ) { // The 'success' parameter means no fatal PHP errors were detected. All // other error management should be handled using 'results'. if ( $ success ) { $ message = \ Drupal :: translation ( ) -> formatPlural ( count ( $ results ) , 'One item deleted.' , '@count items deleted.' ) ; // Provide some feedback when its a success. drupal_set_message ( t ( 'Your group and all of its topics, events and posts have been deleted.' ) ) ; // TODO: log to the database. } else { $ message = t ( 'There was an unexpected error.' ) ; drupal_set_message ( $ message , 'error' ) ; } // Redirect the user back to their groups overview once the batch is done. return new RedirectResponse ( Url :: fromRoute ( 'view.groups.page_user_groups' ) -> setRouteParameter ( 'user' , \ Drupal :: currentUser ( ) -> id ( ) ) -> toString ( ) ) ; }
Callback when the batch for group and content deletion is done.
Callback when the batch for group and content deletion is done .