public function UserExportPluginBase::profileGetTaxonomyFieldValue in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 8.3 modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 8.4 modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 8.5 modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 8.6 modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 8.7 modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 10.3.x modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 10.0.x modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 10.1.x modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
- 10.2.x modules/social_features/social_user_export/src/Plugin/UserExportPluginBase.php \Drupal\social_user_export\Plugin\UserExportPluginBase::profileGetTaxonomyFieldValue()
Returns the values of a taxonomy reference field.
Parameters
string $field_name: The field name to get the value for, should be taxonomy term reference.
\Drupal\profile\Entity\ProfileInterface $user_profile: The profile to get the data for.
Return value
string Returns comma separated string of taxonomy terms of the field.
Overrides UserExportPluginInterface::profileGetTaxonomyFieldValue
4 calls to UserExportPluginBase::profileGetTaxonomyFieldValue()
- OrganizationTag::getValue in modules/
social_features/ social_profile/ modules/ social_profile_organization_tag/ src/ Plugin/ UserExportPlugin/ OrganizationTag.php - Returns the value.
- UserInterests::getValue in modules/
social_features/ social_user_export/ src/ Plugin/ UserExportPlugin/ UserInterests.php - Returns the value.
- UserProfileTag::getValue in modules/
social_features/ social_user_export/ src/ Plugin/ UserExportPlugin/ UserProfileTag.php - Returns the value.
- UserSkills::getValue in modules/
social_features/ social_user_export/ src/ Plugin/ UserExportPlugin/ UserSkills.php - Returns the value.
File
- modules/
social_features/ social_user_export/ src/ Plugin/ UserExportPluginBase.php, line 213
Class
- UserExportPluginBase
- Base class for User export plugin plugins.
Namespace
Drupal\social_user_export\PluginCode
public function profileGetTaxonomyFieldValue($field_name, ProfileInterface $user_profile = NULL) {
if ($user_profile === NULL) {
return '';
}
$names = array_map(function (TermInterface $taxonomy_term) {
return $taxonomy_term
->getName();
}, $user_profile
->get($field_name)
->referencedEntities());
return implode(', ', $names);
}