FieldNumeric.php in EntityFieldQuery Views Backend 8
File
src/Plugin/views/filter/FieldNumeric.php
View source
<?php
namespace Drupal\efq_views\Plugin\views\filter;
use Drupal\Core\Form\FormStateInterface;
class FieldNumeric extends Numeric {
protected function defineOptions() {
$options = parent::defineOptions();
$options['delta'] = array(
'default' => NULL,
);
return $options;
}
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['delta'] = array(
'#type' => 'textfield',
'#title' => t('Delta'),
'#default_value' => $this->options['delta'],
'#description' => t('Numeric delta group identifier. If provided, only values attached to the same delta are matched. Leave empty to match all values.'),
);
}
protected function opSimple($column) {
$this->query->query
->fieldCondition($this->definition['field_name'], $column, $this->value['value'], $this->operator, efq_views_extract_delta($this));
}
protected function opBetween($column) {
$this->query->query
->fieldCondition($this->definition['field_name'], $column, $this->value['value'], "BETWEEN", efq_views_extract_delta($this));
}
}