private function EntityReference::getAutocompleteSuggestions in Conditional Fields 8
Same name and namespace in other branches
- 4.x src/Plugin/conditional_fields/handler/EntityReference.php \Drupal\conditional_fields\Plugin\conditional_fields\handler\EntityReference::getAutocompleteSuggestions()
Get a variants of node title for autocomplete.
Parameters
$node: A node object.
Return value
array An array with a few relevant suggestions for autocomplete.
1 call to EntityReference::getAutocompleteSuggestions()
- EntityReference::statesHandler in src/
Plugin/ conditional_fields/ handler/ EntityReference.php - Executes states handler according to conditional fields settings.
File
- src/
Plugin/ conditional_fields/ handler/ EntityReference.php, line 65
Class
- EntityReference
- Provides states handler for entity reference fields.
Namespace
Drupal\conditional_fields\Plugin\conditional_fields\handlerCode
private function getAutocompleteSuggestions($node) {
/** @var Node $node */
return [
// Node title (nid).
[
'value' => $node
->label() . ' (' . $node
->id() . ')',
],
// Node title.
[
'value' => $node
->label(),
],
];
}