public function ContentImport::createVoc in Content Import 8.3
Same name and namespace in other branches
- 8 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::createVoc()
- 8.4 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::createVoc()
To Create Terms if it is not available.
1 call to ContentImport::createVoc()
- ContentImport::getTermReference in src/
Form/ ContentImport.php - To get Reference field ids.
File
- src/
Form/ ContentImport.php, line 124
Class
- ContentImport
- Configure Content Import settings for this site.
Namespace
Drupal\contentimport\FormCode
public function createVoc($vid, $voc) {
$vocabulary = Vocabulary::create([
'vid' => $vid,
'machine_name' => $vid,
'name' => $voc,
]);
$vocabulary
->save();
}