You are here

public static function TaxonomyDeleteBatch::processVocabulary in Taxonomy Delete 8

Process the vocabulary and delete all the terms associated with it.

Parameters

string $vid: The vocabulary ID.

array $context: The batch context.

File

src/TaxonomyDeleteBatch.php, line 18

Class

TaxonomyDeleteBatch
Batch Processor of the deletion of terms.

Namespace

Drupal\taxonomy_delete

Code

public static function processVocabulary($vid, array $context) {
  $service = \Drupal::service('taxonomy_delete.term_delete');
  $term_count = $service
    ->deleteTermByVid($vid);
  $context['results']['terms'] = $term_count;
  $context['results']['vid'] = $vid;
}