You are here

protected function TermDevelGenerate::deleteVocabularyTerms in Devel 8.2

Same name and namespace in other branches
  1. 8.3 devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\TermDevelGenerate::deleteVocabularyTerms()
  2. 8 devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\TermDevelGenerate::deleteVocabularyTerms()
  3. 4.x devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\TermDevelGenerate::deleteVocabularyTerms()

Deletes all terms of given vocabularies.

Parameters

array $vids: Array of vocabulary vid.

1 call to TermDevelGenerate::deleteVocabularyTerms()
TermDevelGenerate::generateElements in devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php
Business logic relating with each DevelGenerate plugin

File

devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php, line 140

Class

TermDevelGenerate
Provides a TermDevelGenerate plugin.

Namespace

Drupal\devel_generate\Plugin\DevelGenerate

Code

protected function deleteVocabularyTerms($vids) {
  $tids = $this->vocabularyStorage
    ->getToplevelTids($vids);
  $terms = $this->termStorage
    ->loadMultiple($tids);
  $this->termStorage
    ->delete($terms);
}