You are here

protected function SettingsForm::loadConfigEntity in Entity Print 8

Same name and namespace in other branches
  1. 8.2 src/Form/SettingsForm.php \Drupal\entity_print\Form\SettingsForm::loadConfigEntity()

Gets the config entity backing the specified plugin.

Parameters

string $plugin_id: The PDF engine plugin id.

Return value

\Drupal\entity_print\Entity\PdfEngine The loaded config object backing the plugin.

2 calls to SettingsForm::loadConfigEntity()
SettingsForm::submitForm in src/Form/SettingsForm.php
Form submission handler.
SettingsForm::validateForm in src/Form/SettingsForm.php
Form validation handler.

File

src/Form/SettingsForm.php, line 226

Class

SettingsForm
Defines a form that configures Entity Print settings.

Namespace

Drupal\entity_print\Form

Code

protected function loadConfigEntity($plugin_id) {
  if (!($entity = $this->storage
    ->load($plugin_id))) {
    $entity = $this->storage
      ->create([
      'id' => $plugin_id,
    ]);
  }
  return $entity;
}