You are here

public function WebformDefaultViews::getElementViewsData in Webform Views Integration 8.5

Generate views data definition that corresponds to given webform element.

Parameters

\Drupal\webform\Plugin\WebformElementInterface $element_plugin: Webform element plugin whose views data definition is requested

array $element: Webform element whose views data definition is requested

Return value

array Views data definition array that corresponds to the given webform element. The structure of this array should have the following structure:

  • field: (array) Views data 'field' section to use for this webform element
  • filter: (array) Views data 'filter' section to use for this webform element
  • sort: (array) Views data 'sort' section to use for this webform element
  • TODO: Do you need more here?

Overrides WebformElementViewsAbstract::getElementViewsData

7 calls to WebformDefaultViews::getElementViewsData()
WebformDateViews::getElementViewsData in src/WebformElementViews/WebformDateViews.php
Generate views data definition that corresponds to given webform element.
WebformEntityReferenceViews::getElementViewsData in src/WebformElementViews/WebformEntityReferenceViews.php
Generate views data definition that corresponds to given webform element.
WebformHiddenViews::getElementViewsData in src/WebformElementViews/WebformHiddenViews.php
Generate views data definition that corresponds to given webform element.
WebformNumericViews::getElementViewsData in src/WebformElementViews/WebformNumericViews.php
Generate views data definition that corresponds to given webform element.
WebformSelectOtherViews::getElementViewsData in src/WebformElementViews/WebformSelectOtherViews.php
Generate views data definition that corresponds to given webform element.

... See full list

7 methods override WebformDefaultViews::getElementViewsData()
WebformDateViews::getElementViewsData in src/WebformElementViews/WebformDateViews.php
Generate views data definition that corresponds to given webform element.
WebformEntityReferenceViews::getElementViewsData in src/WebformElementViews/WebformEntityReferenceViews.php
Generate views data definition that corresponds to given webform element.
WebformHiddenViews::getElementViewsData in src/WebformElementViews/WebformHiddenViews.php
Generate views data definition that corresponds to given webform element.
WebformNumericViews::getElementViewsData in src/WebformElementViews/WebformNumericViews.php
Generate views data definition that corresponds to given webform element.
WebformSelectOtherViews::getElementViewsData in src/WebformElementViews/WebformSelectOtherViews.php
Generate views data definition that corresponds to given webform element.

... See full list

File

src/WebformElementViews/WebformDefaultViews.php, line 21

Class

WebformDefaultViews
Default webform views handler for webform elements.

Namespace

Drupal\webform_views\WebformElementViews

Code

public function getElementViewsData(WebformElementInterface $element_plugin, array $element) {
  $views_data = parent::getElementViewsData($element_plugin, $element);
  if ($element_plugin
    ->isInput($element) && !$element_plugin
    ->hasMultipleValues($element)) {
    $views_data['sort'] = [
      'id' => 'webform_submission_field_sort',
      'real field' => 'value',
    ];
  }
  if ($element_plugin
    ->isInput($element)) {
    $views_data['filter'] = [
      'id' => 'webform_submission_field_filter',
      'real field' => 'value',
    ];
    $views_data['argument'] = [
      'id' => 'standard',
      'real field' => 'value',
    ];
  }
  return $views_data;
}