You are here

protected function WebformSubmissionExporter::appendExporterToStates in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformSubmissionExporter.php \Drupal\webform\WebformSubmissionExporter::appendExporterToStates()

Append exporter plugin id to #states API array.

Parameters

array $states: A #states API array.

string $plugin_id: The exporter plugin id.

1 call to WebformSubmissionExporter::appendExporterToStates()
WebformSubmissionExporter::buildExportOptionsForm in src/WebformSubmissionExporter.php
Build export options webform.

File

src/WebformSubmissionExporter.php, line 771

Class

WebformSubmissionExporter
Webform submission exporter.

Namespace

Drupal\webform

Code

protected function appendExporterToStates(array &$states, $plugin_id) {
  $state = key($states);
  if ($states[$state]) {
    $states[$state][] = 'or';
  }
  $states[$state][] = [
    ':input[name="exporter"]' => [
      'value' => $plugin_id,
    ],
  ];
}