protected function InstallHelper::processTerm in Drupal 9
Same name and namespace in other branches
- 8 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processTerm()
Process terms for a given vocabulary and filename.
Parameters
array $data: Data of line that was read from the file.
string $vocabulary: Machine name of vocabulary to which we should save terms.
Return value
array Data structured as a term.
1 call to InstallHelper::processTerm()
- InstallHelper::processContent in core/
profiles/ demo_umami/ modules/ demo_umami_content/ src/ InstallHelper.php - Process content into a structure that can be saved into Drupal.
File
- core/
profiles/ demo_umami/ modules/ demo_umami_content/ src/ InstallHelper.php, line 333
Class
- InstallHelper
- Defines a helper class for importing default content.
Namespace
Drupal\demo_umami_contentCode
protected function processTerm(array $data, $vocabulary) {
$term_name = trim($data['term']);
// Prepare content.
$values = [
'name' => $term_name,
'vid' => $vocabulary,
'path' => [
'alias' => '/' . Html::getClass($vocabulary) . '/' . Html::getClass($term_name),
],
'langcode' => 'en',
];
return $values;
}