You are here

protected function ReferenceWidget::getEntityStorage in Select (or other) 4.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/ReferenceWidget.php \Drupal\select_or_other\Plugin\Field\FieldWidget\ReferenceWidget::getEntityStorage()

Retrieves the entityStorage object.

@codeCoverageIgnore Ignore this method because if ::getFieldSetting() or entityTypeManager does not return the expected result, we have other problems on our hands.

Return value

\Drupal\Core\Entity\EntityStorageInterface EntityStorage for entity types that can be referenced by this widget.

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

File

src/Plugin/Field/FieldWidget/ReferenceWidget.php, line 87

Class

ReferenceWidget
Plugin implementation of the 'select_or_other_reference' widget.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

protected function getEntityStorage() {
  $target_type = $this
    ->getFieldSetting('target_type');
  return $this->entityTypeManager
    ->getStorage($target_type);
}