You are here

function WebformSubmissionHiddenFilter::operators in Webform Views Integration 8.5

This kind of construct makes it relatively easy for a child class to add or remove functionality by overriding this function and adding/removing items from this array.

Overrides WebformSubmissionFieldFilter::operators

File

src/Plugin/views/filter/WebformSubmissionHiddenFilter.php, line 15

Class

WebformSubmissionHiddenFilter
Filter based on value of a webform submission for 'hidden' element type.

Namespace

Drupal\webform_views\Plugin\views\filter

Code

function operators() {
  $operators = parent::operators();

  // Replace all occurrences of "use the element type itself" (which would be
  // hidden and thus, simply pointless) with "textfield".
  foreach ($operators as $k => $v) {
    if ($operators[$k]['webform_views_element_type'] == WebformSubmissionFieldFilter::ELEMENT_TYPE) {
      $operators[$k]['webform_views_element_type'] = 'textfield';
    }
  }
  return $operators;
}