You are here

protected function InlineEntityFormSimple::getBundle in Inline Entity Form 8

Gets the bundle for the inline entity.

Return value

string|null The bundle, or NULL if not known.

1 call to InlineEntityFormSimple::getBundle()
InlineEntityFormSimple::formElement in src/Plugin/Field/FieldWidget/InlineEntityFormSimple.php
Returns the form for a single field widget.

File

src/Plugin/Field/FieldWidget/InlineEntityFormSimple.php, line 211

Class

InlineEntityFormSimple
Simple inline widget.

Namespace

Drupal\inline_entity_form\Plugin\Field\FieldWidget

Code

protected function getBundle() {
  if (!empty($this
    ->getFieldSetting('handler_settings')['target_bundles'])) {
    return reset($this
      ->getFieldSetting('handler_settings')['target_bundles']);
  }
}