You are here

interface EntityAutocompleteMatcherInterface in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface
  2. 10 core/lib/Drupal/Core/Entity/EntityAutocompleteMatcherInterface.php \Drupal\Core\Entity\EntityAutocompleteMatcherInterface

Hierarchy

Expanded class hierarchy of EntityAutocompleteMatcherInterface

All classes that implement EntityAutocompleteMatcherInterface

1 file declares its use of EntityAutocompleteMatcherInterface
EntityAutocompleteController.php in core/modules/system/src/Controller/EntityAutocompleteController.php

File

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

Namespace

Drupal\Core\Entity
View source
interface EntityAutocompleteMatcherInterface {

  /**
   * Gets matched labels based on a given search string.
   *
   * @param string $target_type
   *   The ID of the target entity type.
   * @param string $selection_handler
   *   The plugin ID of the entity reference selection handler.
   * @param array $selection_settings
   *   An array of settings that will be passed to the selection handler.
   * @param string $string
   *   (optional) The label of the entity to query by.
   *
   * @return 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 \Drupal\system\Controller\EntityAutocompleteController
   */
  public function getMatches($target_type, $selection_handler, $selection_settings, $string = '');

}

Members

Namesort descending Modifiers Type Description Overrides
EntityAutocompleteMatcherInterface::getMatches public function Gets matched labels based on a given search string. 1