mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 00:34:03 +02:00
Filters: try to give meaningful results for...
...missing columns refs #4787
This commit is contained in:
parent
8987b69d55
commit
6d705721e3
@ -6,9 +6,12 @@ namespace Icinga\Data\Filter;
|
|||||||
|
|
||||||
class FilterGreaterThan extends FilterExpression
|
class FilterGreaterThan extends FilterExpression
|
||||||
{
|
{
|
||||||
|
|
||||||
public function matches($row)
|
public function matches($row)
|
||||||
{
|
{
|
||||||
|
if (! isset($row->{$this->column})) {
|
||||||
|
// TODO: REALLY? Exception?
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return (string) $row->{$this->column} > (string) $this->expression;
|
return (string) $row->{$this->column} > (string) $this->expression;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,10 @@ class FilterMatch extends FilterExpression
|
|||||||
{
|
{
|
||||||
public function matches($row)
|
public function matches($row)
|
||||||
{
|
{
|
||||||
|
if (! isset($row->{$this->column})) {
|
||||||
|
// TODO: REALLY? Exception?
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$expression = (string) $this->expression;
|
$expression = (string) $this->expression;
|
||||||
if (strpos($expression, '*') === false) {
|
if (strpos($expression, '*') === false) {
|
||||||
return (string) $row->{$this->column} === $expression;
|
return (string) $row->{$this->column} === $expression;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user