WebformSubmissionTermCheckboxesFilter.php in Webform Views Integration 8.5
File
src/Plugin/views/filter/WebformSubmissionTermCheckboxesFilter.php
View source
<?php
namespace Drupal\webform_views\Plugin\views\filter;
use Drupal\Core\Form\FormStateInterface;
class WebformSubmissionTermCheckboxesFilter extends WebformSubmissionFieldFilter {
public function valueForm(&$form, FormStateInterface $form_state) {
parent::valueForm($form, $form_state);
$form['value']['#attached']['library'][] = 'webform_views/filter.webform_term_checkboxes';
}
public function opEqual($field) {
$value = array_values(array_filter($this->value));
if (empty($value)) {
return;
}
$this
->ensureMyTable();
$this->query
->addWhere($this->options['group'], "{$this->tableAlias}.{$this->realField}", $value, $this->operator == '=' ? 'IN' : 'NOT IN');
}
}