protected function DemoUser::prepareTerms in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.2 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.3 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.4 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.5 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.6 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.7 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 8.8 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 10.3.x modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 10.0.x modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
- 10.2.x modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::prepareTerms()
Returns taxonomy terms for UUIDs.
Parameters
array $values: A list of UUIDs for terms.
Return value
array Returns an empty array or one filled with taxonomy terms.
1 call to DemoUser::prepareTerms()
- DemoUser::createContent in modules/
custom/ social_demo/ src/ DemoUser.php - Creates content.
File
- modules/
custom/ social_demo/ src/ DemoUser.php, line 176
Class
- DemoUser
- Class DemoUser.
Namespace
Drupal\social_demoCode
protected function prepareTerms(array $values) {
$terms = [];
foreach ($values as $uuid) {
$term = $this->termStorage
->loadByProperties([
'uuid' => $uuid,
]);
$term = reset($term);
if (!empty($term)) {
$terms[] = [
'target_id' => $term
->id(),
];
}
}
return $terms;
}