protected function Topic::prepareTopicType in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.2 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.3 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.4 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.5 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.6 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.7 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 8.8 modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 10.3.x modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 10.0.x modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 10.1.x modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
- 10.2.x modules/custom/social_demo/src/Plugin/DemoContent/Topic.php \Drupal\social_demo\Plugin\DemoContent\Topic::prepareTopicType()
Returns taxonomy term id.
Parameters
string $name: Term name.
Return value
array|null Array containing related terms.
1 call to Topic::prepareTopicType()
- Topic::getEntry in modules/
custom/ social_demo/ src/ Plugin/ DemoContent/ Topic.php - Makes an array with data of an entity.
File
- modules/
custom/ social_demo/ src/ Plugin/ DemoContent/ Topic.php, line 166
Class
- Topic
- Topic Plugin for demo content.
Namespace
Drupal\social_demo\Plugin\DemoContentCode
protected function prepareTopicType($name) {
$value = NULL;
$terms = $this->termStorage
->loadByProperties([
'name' => $name,
]);
if ($terms) {
$value = [
[
'target_id' => current($terms)
->id(),
],
];
}
return $value;
}