You are here

public function WebformEntityHandler::getSummary in Webform Entity Handler 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/WebformHandler/WebformEntityHandler.php \Drupal\webform_entity_handler\Plugin\WebformHandler\WebformEntityHandler::getSummary()

Returns a render array summarizing the configuration of the webform handler.

Return value

array A render array.

Overrides WebformHandlerBase::getSummary

File

src/Plugin/WebformHandler/WebformEntityHandler.php, line 109

Class

WebformEntityHandler
Create or update an entity with a webform submission values.

Namespace

Drupal\webform_entity_handler\Plugin\WebformHandler

Code

public function getSummary() {
  $configuration = $this
    ->getConfiguration();
  $settings = $configuration['settings'];

  // Get state labels.
  $states = [
    WebformSubmissionInterface::STATE_DRAFT => $this
      ->t('Draft Saved'),
    WebformSubmissionInterface::STATE_CONVERTED => $this
      ->t('Converted'),
    WebformSubmissionInterface::STATE_COMPLETED => $this
      ->t('Completed'),
    WebformSubmissionInterface::STATE_UPDATED => $this
      ->t('Updated'),
    WebformSubmissionInterface::STATE_LOCKED => $this
      ->t('Locked'),
  ];
  $settings['states'] = array_intersect_key($states, array_combine($settings['states'], $settings['states']));
  return [
    '#settings' => $settings,
  ] + parent::getSummary();
}