You are here

protected function ReferenceWidget::getBundleKey in Select (or other) 8.3

Retrieves the key used to indicate a bundle for the entity type.

@codeCoverageIgnore Ignore this method because if any of the called core functions does not return the expected result, we've got other problems on our hands.

Return value

string The key used to indicate a bundle for the entity type referenced by this widget's field.

1 call to ReferenceWidget::getBundleKey()
ReferenceWidget::getOptions in src/Plugin/Field/FieldWidget/EntityReference/ReferenceWidget.php
Returns the array of options for the widget.

File

src/Plugin/Field/FieldWidget/EntityReference/ReferenceWidget.php, line 74
Contains \Drupal\select_or_other\Plugin\Field\FieldWidget\EntityReference\ReferenceWidget.

Class

ReferenceWidget
Plugin implementation of the 'select_or_other_reference' widget.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget\EntityReference

Code

protected function getBundleKey() {
  $entity_keys = $this
    ->getEntityStorage()
    ->getEntityType()
    ->get('entity_keys');
  return $entity_keys['bundle'];
}