You are here

public function EntityAutocompleteMatcherInterface::getMatches in Drupal 8

Same name and namespace in other branches
  1. 9 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

EntityAutocompleteMatcherInterface

Namespace

Drupal\Core\Entity

Code

public function getMatches($target_type, $selection_handler, $selection_settings, $string = '');