private function PageContext::getAvailableFieldVocabularyNames in Acquia Lift Connector 8
Same name and namespace in other branches
- 8.4 src/Service/Context/PageContext.php \Drupal\acquia_lift\Service\Context\PageContext::getAvailableFieldVocabularyNames()
- 8.3 src/Service/Context/PageContext.php \Drupal\acquia_lift\Service\Context\PageContext::getAvailableFieldVocabularyNames()
Get available Fields and their vocabulary names within the node.
Parameters
\Drupal\Core\Entity\EntityInterface $node: Node.
Return value
array Node's available Fields' Vocabularies names.
1 call to PageContext::getAvailableFieldVocabularyNames()
- PageContext::setFields in src/
Service/ Context/ PageContext.php - Set fields.
File
- src/
Service/ Context/ PageContext.php, line 174 - Contains \Drupal\acquia_lift\Service\Context\PageContext.
Class
Namespace
Drupal\acquia_lift\Service\ContextCode
private function getAvailableFieldVocabularyNames(EntityInterface $node) {
$available_field_vocabulary_names = [];
foreach ($this->fieldMappings as $page_context_name => $field_name) {
if (!isset($node->{$field_name})) {
continue;
}
$vocabulary_names = $node->{$field_name}
->getSetting('handler_settings')['target_bundles'];
$available_field_vocabulary_names[$page_context_name] = $vocabulary_names;
}
return $available_field_vocabulary_names;
}