private function SocialProfileTagService::prepareTermOptions in Open Social 10.3.x
Same name and namespace in other branches
- 10.2.x modules/social_features/social_profile/src/SocialProfileTagService.php \Drupal\social_profile\SocialProfileTagService::prepareTermOptions()
Helper function to prepare term options.
Parameters
array $terms: Array of terms.
Return value
array Returns a list of terms options.
2 calls to SocialProfileTagService::prepareTermOptions()
- SocialProfileTagService::getCategories in modules/
social_features/ social_profile/ src/ SocialProfileTagService.php - Returns all the top level term items, that are considered categories.
- SocialProfileTagService::getChildrens in modules/
social_features/ social_profile/ src/ SocialProfileTagService.php - Returns the children of top level term items.
File
- modules/
social_features/ social_profile/ src/ SocialProfileTagService.php, line 222
Class
- SocialProfileTagService
- Provide a service for profile tagging.
Namespace
Drupal\social_profileCode
private function prepareTermOptions(array $terms) {
$options = [];
foreach ($terms as $category) {
$options[$category->tid] = $category->name;
}
return $options;
}