public static function deleteGroupAndContent($nids, $posts, &$context) {
    $results = [];
    // Load each node and delete it.
    foreach ($nids as $nid) {
      $node = Node::load($nid);
      $message = t('Delete @type "@title"', ['@type' => $node->getType(), '@title' => $node->getTitle()]);
      $results[] = $node->delete();
    }
    // Load each post and delete it.
    foreach ($posts as $post_id) {
      $post = Post::load($post_id);
      $message = t("Deleting @type\'s", ['@type' => $post->bundle()]);
      $results[] = $post->delete();
    }
    $context['message'] = $message;
    $context['results'] = $results;
  }
public static function deleteGroupAndContent($nids, $posts, &$context) {
    $results = [];
    // Load each node and delete it.
    foreach ($nids as $nid) {
      $node = Node::load($nid);
      $message = t('Delete @type "@title"', ['@type' => $node->getType(), '@title' => $node->getTitle()]);
      $results[] = $node->delete();
    }
    // Load each post and delete it.
    foreach ($posts as $post_id) {
      $post = Post::load($post_id);
      $message = t("Deleting @type\'s", ['@type' => $post->bundle()]);
      $results[] = $post->delete();
    }
    $context['message'] = $message;
    $context['results'] = $results;
  }
public static function deleteGroupAndContent ( $ nids , $ posts , & $ context ) { $ results = [ ] ; // Load each node and delete it. foreach ( $ nids as $ nid ) { $ node = Node :: load ( $ nid ) ; $ message = t ( 'Delete @type "@title"' , [ '@type' => $ node -> getType ( ) , '@title' => $ node -> getTitle ( ) ] ) ; $ results [ ] = $ node -> delete ( ) ; } // Load each post and delete it. foreach ( $ posts as $ post_id ) { $ post = Post :: load ( $ post_id ) ; $ message = t ( "Deleting @type\'s" , [ '@type' => $ post -> bundle ( ) ] ) ; $ results [ ] = $ post -> delete ( ) ; } $ context [ 'message' ] = $ message ; $ context [ 'results' ] = $ results ; }
Get the group and all of its content that needs to be deleted.
Get the group and all of its content that needs to be deleted .