mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +02:00
Filter: allow to list all filtered columns
This is important for backends that need to know which additional columns to fetch. refs #4787
This commit is contained in:
parent
e96ecc5271
commit
8987b69d55
@ -52,6 +52,8 @@ abstract class Filter
|
|||||||
return false === strpos($this->id, '-');
|
return false === strpos($this->id, '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract public function listFilteredColumns();
|
||||||
|
|
||||||
public function applyChanges($changes)
|
public function applyChanges($changes)
|
||||||
{
|
{
|
||||||
$filter = $this;
|
$filter = $this;
|
||||||
|
@ -117,6 +117,20 @@ abstract class FilterChain extends Filter
|
|||||||
return $this->operatorSymbol;
|
return $this->operatorSymbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listFilteredColumns()
|
||||||
|
{
|
||||||
|
$columns = array();
|
||||||
|
foreach ($this->filters as $filter) {
|
||||||
|
if ($filter instanceof FilterExpression) {
|
||||||
|
$columns[] = $filter->getColumn();
|
||||||
|
} else {
|
||||||
|
$columns += $filter->listFilteredColumns();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// array_unique?
|
||||||
|
return $columns;
|
||||||
|
}
|
||||||
|
|
||||||
public function toQueryString()
|
public function toQueryString()
|
||||||
{
|
{
|
||||||
$parts = array();
|
$parts = array();
|
||||||
|
@ -59,6 +59,11 @@ class FilterExpression extends Filter
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listFilteredColumns()
|
||||||
|
{
|
||||||
|
return array($this->getColumn());
|
||||||
|
}
|
||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
$expression = is_array($this->expression) ?
|
$expression = is_array($this->expression) ?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user