function EntityAutocompleteMatcherInterface::getMatches
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface::getMatches()
- 8.9.x core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface::getMatches()
- 10 core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface::getMatches()
Gets matched labels based on a given search string.
Parameters
string $target_type: The ID of the target entity type.
string $selection_handler: The plugin ID of the entity reference selection handler.
array $selection_settings: An array of settings that will be passed to the selection handler.
string $string: (optional) The label of the entity to query by.
Return value
array An array of matched entity labels, in the format required by the AJAX autocomplete API (e.g. array('value' => $value, 'label' => $label)).
Throws
\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException Thrown when the current user doesn't have access to the specified entity.
See also
\Drupal\system\Controller\EntityAutocompleteController
1 method overrides EntityAutocompleteMatcherInterface::getMatches()
- EntityAutocompleteMatcher::getMatches in core/
lib/ Drupal/ Core/ Entity/ EntityAutocompleteMatcher.php - Gets matched labels based on a given search string.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityAutocompleteMatcherInterface.php, line 28
Class
Namespace
Drupal\Core\EntityCode
public function getMatches($target_type, $selection_handler, $selection_settings, $string = '');
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.