You are here

protected function InlineEntityFormBase::getEntityFormMode in Inline Entity Form 8

Gets the entity form mode instance for this widget.

Return value

\Drupal\Core\Entity\EntityFormModeInterface|null The form mode instance, or NULL if the default one is used.

2 calls to InlineEntityFormBase::getEntityFormMode()
InlineEntityFormBase::calculateDependencies in src/Plugin/Field/FieldWidget/InlineEntityFormBase.php
Calculates dependencies for the configured plugin.
InlineEntityFormBase::settingsSummary in src/Plugin/Field/FieldWidget/InlineEntityFormBase.php
Returns a short summary for the current widget settings.

File

src/Plugin/Field/FieldWidget/InlineEntityFormBase.php, line 559

Class

InlineEntityFormBase
Inline entity form widget base class.

Namespace

Drupal\inline_entity_form\Plugin\Field\FieldWidget

Code

protected function getEntityFormMode() {
  $form_mode = $this
    ->getSetting('form_mode');
  if ($form_mode != 'default') {
    $entity_type_id = $this
      ->getFieldSetting('target_type');
    return $this->entityTypeManager
      ->getStorage('entity_form_mode')
      ->load($entity_type_id . '.' . $form_mode);
  }
  return NULL;
}