protected function TaxonomyTermMatch::getTermLabel in Acquia Content Hub 8.2
Get term label from CDF object.
Parameters
\Acquia\ContentHubClient\CDF\CDFObject $cdf_object: CDF object.
Return value
string|null Term label.
1 call to TaxonomyTermMatch::getTermLabel()
- TaxonomyTermMatch::onLoadLocalEntity in modules/
acquia_contenthub_subscriber/ src/ EventSubscriber/ LoadLocalEntity/ TaxonomyTermMatch.php - Load local terms with the same name, vocabulary and relative parent.
File
- modules/
acquia_contenthub_subscriber/ src/ EventSubscriber/ LoadLocalEntity/ TaxonomyTermMatch.php, line 96
Class
- TaxonomyTermMatch
- Class TaxonomyTermMatch.
Namespace
Drupal\acquia_contenthub_subscriber\EventSubscriber\LoadLocalEntityCode
protected function getTermLabel(CDFObject $cdf_object) : ?string {
$term_language = $cdf_object
->getMetadata()['default_language'];
$label = $cdf_object
->getAttribute('label')
->getValue();
return $label[$term_language] ?? $label[CDFObject::LANGUAGE_UNDETERMINED] ?? NULL;
}