public function ContentImport::createTerm in Content Import 8
Same name and namespace in other branches
- 8.3 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::createTerm()
- 8.4 src/Form/ContentImport.php \Drupal\contentimport\Form\ContentImport::createTerm()
To Create Terms if it is not available.
1 call to ContentImport::createTerm()
- ContentImport::getTermReference in src/
Form/ ContentImport.php - To get Reference field ids.
File
- src/
Form/ ContentImport.php, line 146 - Contains \Drupal\contentimport\Form\ContentImport.
Class
- ContentImport
- Configure Content Import settings for this site.
Namespace
Drupal\contentimport\FormCode
public function createTerm($voc, $term, $vid) {
Term::create(array(
'parent' => array(
$voc,
),
'name' => $term,
'vid' => $vid,
))
->save();
$termId = ContentImport::getTermId($term, $vid);
return $termId;
}