You are here

public static function TaxonomyMultideleteBatch::processTerms in Taxonomy Multi-delete Terms 8

Process delete all the terms.

Parameters

string $tids: The Term ID.

array $context: The batch context.

File

src/TaxonomyMultideleteBatch.php, line 18

Class

TaxonomyMultideleteBatch
Batch Processor of the deletion of terms.

Namespace

Drupal\taxonomy_multidelete_terms

Code

public static function processTerms($tids, array $context) {
  $controller = \Drupal::entityTypeManager()
    ->getStorage('taxonomy_term');
  $entities = $controller
    ->loadMultiple($tids);
  $controller
    ->delete($entities);
  $context['results']['terms'] = count($tids);
}