function WebformCivicrmPostProcess::initialize in Webform CiviCRM Integration 8.5
Overrides WebformCivicrmPostProcessInterface::initialize
File
- src/
WebformCivicrmPostProcess.php, line 70 - Front-end form validation and post-processing.
Class
Namespace
Drupal\webform_civicrmCode
function initialize(WebformInterface $webform) {
if ($this->initialized) {
return $this;
}
$this->node = $webform;
$handler_collection = $webform
->getHandlers('webform_civicrm');
$instance_ids = $handler_collection
->getInstanceIds();
$handler = $handler_collection
->get(reset($instance_ids));
$utils = \Drupal::service('webform_civicrm.utils');
$this->database = \Drupal::database();
$this->settings = $handler
->getConfiguration()['settings'];
$this->data = $this->settings['data'];
$this->enabled = $utils
->wf_crm_enabled_fields($webform);
$this->all_fields = $utils
->wf_crm_get_fields();
$this->all_sets = $utils
->wf_crm_get_fields('sets');
$this->initialized = TRUE;
return $this;
}