function VocabularyDevelGenerate::generateElements
Same name in other branches
- 5.x devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\VocabularyDevelGenerate::generateElements()
Overrides DevelGenerateBase::generateElements
File
-
devel_generate/
src/ Plugin/ DevelGenerate/ VocabularyDevelGenerate.php, line 96
Class
- VocabularyDevelGenerate
- Provides a VocabularyDevelGenerate plugin.
Namespace
Drupal\devel_generate\Plugin\DevelGenerateCode
public function generateElements(array $values) {
if ($values['kill']) {
$this->deleteVocabularies();
$this->setMessage($this->t('Deleted existing vocabularies.'));
}
$new_vocs = $this->generateVocabularies($values['num'], $values['title_length']);
if (!empty($new_vocs)) {
$this->setMessage($this->t('Created the following new vocabularies: @vocs', [
'@vocs' => implode(', ', $new_vocs),
]));
}
}