Drupal 8  8.0.2
EntityAutocompleteController Class Reference
Inheritance diagram for EntityAutocompleteController:

Public Member Functions

 __construct (EntityAutocompleteMatcher $matcher, KeyValueStoreInterface $key_value)
 
 handleAutocomplete (Request $request, $target_type, $selection_handler, $selection_settings_key)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $matcher
 
 $keyValue
 

Detailed Description

Defines a route controller for entity autocomplete form elements.

Constructor & Destructor Documentation

__construct ( EntityAutocompleteMatcher  $matcher,
KeyValueStoreInterface  $key_value 
)

Constructs a EntityAutocompleteController object.

Parameters
\Drupal\Core\Entity\EntityAutocompleteMatcher$matcherThe autocomplete matcher for entity references.
\Drupal\Core\KeyValueStore\KeyValueStoreInterface$key_valueThe key value factory.

References Drupal\keyValue().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container)
static

{}

Referenced by EntityAutocompleteTest\getAutocompleteResult(), and EntityAutocompleteTest\testSelectionSettingsHandling().

Here is the caller graph for this function:

handleAutocomplete ( Request  $request,
  $target_type,
  $selection_handler,
  $selection_settings_key 
)

Autocomplete the label of an entity.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object that contains the typed tags.
string$target_typeThe ID of the target entity type.
string$selection_handlerThe plugin ID of the entity reference selection handler.
string$selection_settings_keyThe hashed key of the key/value entry that holds the selection handler settings.
Returns
The matched entity labels as a JSON response.
Exceptions
\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpExceptionThrown if the selection settings key is not found in the key/value store or if it does not match the stored data.

References Tags\explode(), Settings\getHashSalt(), Crypt\hmacBase64(), Drupal\keyValue(), and Unicode\strtolower().

Here is the call graph for this function:


The documentation for this class was generated from the following file: