You are here

protected function EntityReferenceBrowserWidget::getFormStateKey in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php \Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget::getFormStateKey()

Returns a key used to store the previously loaded entity.

Parameters

\Drupal\Core\Field\FieldItemListInterface $items: The field items.

Return value

string A key for form state storage.

2 calls to EntityReferenceBrowserWidget::getFormStateKey()
EntityReferenceBrowserWidget::formElement in src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php
Returns the form for a single field widget.
EntityReferenceBrowserWidget::formElementEntities in src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php
Determines the entities used for the form element.

File

src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php, line 367

Class

EntityReferenceBrowserWidget
Plugin implementation of the 'entity_reference' widget for entity browser.

Namespace

Drupal\entity_browser\Plugin\Field\FieldWidget

Code

protected function getFormStateKey(FieldItemListInterface $items) {
  return $items
    ->getEntity()
    ->uuid() . ':' . $items
    ->getFieldDefinition()
    ->getName();
}