function EntityAutocompleteMatcherInterface::getMatches

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface::getMatches()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface::getMatches()
  3. 11.x 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

File

core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php, line 28

Class

EntityAutocompleteMatcherInterface

Namespace

Drupal\Core\Entity

Code

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.