You are here

private function AdminForm::initializeForm in Webform CiviCRM Integration 8.5

Initialize form on first view

1 call to AdminForm::initializeForm()
AdminForm::buildForm in src/AdminForm.php
Build admin form for civicrm tab of a webform

File

src/AdminForm.php, line 137
Webform CiviCRM module's admin form.

Class

AdminForm
@file Webform CiviCRM module's admin form.

Namespace

Drupal\webform_civicrm

Code

private function initializeForm() {
  $handler_collection = $this->webform
    ->getHandlers('webform_civicrm');
  if ($handler_collection
    ->count()) {

    /** @var \Drupal\webform\Plugin\WebformHandlerInterface $handler */
    $handler = $handler_collection
      ->get('webform_civicrm');
  }
  else {
    $handler_mananger = \Drupal::getContainer()
      ->get('plugin.manager.webform.handler');
    $handler = $handler_mananger
      ->createInstance('webform_civicrm');
    $handler
      ->setWebform($this->webform);
  }
  $handler_configuration = $handler
    ->getConfiguration();
  $this->settings = $handler_configuration['settings'];
  $this->data =& $this->settings['data'];
}