public function Date::acceptExposedInput in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::acceptExposedInput()
Do some minor translation of the exposed input
Overrides NumericFilter::acceptExposedInput
File
- core/
modules/ views/ src/ Plugin/ views/ filter/ Date.php, line 133 - Contains \Drupal\views\Plugin\views\filter\Date.
Class
- Date
- Filter to handle dates stored as a timestamp.
Namespace
Drupal\views\Plugin\views\filterCode
public function acceptExposedInput($input) {
if (empty($this->options['exposed'])) {
return TRUE;
}
// Store this because it will get overwritten.
$type = $this->value['type'];
$rc = parent::acceptExposedInput($input);
// Don't filter if value(s) are empty.
$operators = $this
->operators();
if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator_id'])) {
$operator = $input[$this->options['expose']['operator_id']];
}
else {
$operator = $this->operator;
}
if ($operators[$operator]['values'] == 1) {
if ($this->value['value'] == '') {
return FALSE;
}
}
else {
if ($this->value['min'] == '' || $this->value['max'] == '') {
return FALSE;
}
}
// restore what got overwritten by the parent.
$this->value['type'] = $type;
return $rc;
}