function Date::hasValidGroupedValue
Same name in other branches
- 9 core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::hasValidGroupedValue()
- 8.9.x core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::hasValidGroupedValue()
- 11.x core/modules/views/src/Plugin/views/filter/Date.php \Drupal\views\Plugin\views\filter\Date::hasValidGroupedValue()
Overrides FilterPluginBase::hasValidGroupedValue
File
-
core/
modules/ views/ src/ Plugin/ views/ filter/ Date.php, line 103
Class
- Date
- Filter to handle dates stored as a timestamp.
Namespace
Drupal\views\Plugin\views\filterCode
protected function hasValidGroupedValue(array $group) {
if (!is_array($group['value']) || empty($group['value'])) {
return FALSE;
}
// Special case when validating grouped date filters because the
// $group['value'] array contains the type of filter (date or offset) and
// therefore the number of items the comparison has to be done against is
// one greater.
$operators = $this->operators();
$expected = $operators[$group['operator']]['values'] + 1;
$actual = count(array_filter($group['value'], [
static::class,
'arrayFilterZero',
]));
return $actual == $expected;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.