You are here

protected function InlineEntityFormBase::getEntityTypeLabels in Inline Entity Form 8

Gets the entity type managed by this handler.

Return value

\Drupal\Core\Entity\EntityTypeInterface The entity type.

5 calls to InlineEntityFormBase::getEntityTypeLabels()
InlineEntityFormBase::getInlineEntityForm in src/Plugin/Field/FieldWidget/InlineEntityFormBase.php
Gets inline entity form element.
InlineEntityFormComplex::buildRemoveForm in src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
Builds remove form.
InlineEntityFormComplex::formElement in src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
Returns the form for a single field widget.
InlineEntityFormComplex::settingsForm in src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
Returns a form to configure settings for the widget.
InlineEntityFormComplex::settingsSummary in src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
Returns a short summary for the current widget settings.

File

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

Class

InlineEntityFormBase
Inline entity form widget base class.

Namespace

Drupal\inline_entity_form\Plugin\Field\FieldWidget

Code

protected function getEntityTypeLabels() {

  // The admin has specified the exact labels that should be used.
  if ($this
    ->getSetting('override_labels')) {
    return [
      'singular' => $this
        ->getSetting('label_singular'),
      'plural' => $this
        ->getSetting('label_plural'),
    ];
  }
  else {
    $this
      ->createInlineFormHandler();
    return $this->inlineFormHandler
      ->getEntityTypeLabels();
  }
}