Skip to content

Commit

Permalink
Livestatus\Query: some more filter-related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Gelf committed Nov 16, 2014
1 parent 46b047b commit 628597d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions library/Icinga/Protocol/Livestatus/Query.php
Expand Up @@ -18,13 +18,24 @@ class Query extends SimpleQuery
{
protected $customvars = array();

/**
* Columns in this array are always "combined" ones creating their value
* based on a filter expression. The result is always either "1" or "0"
*/
protected $filter_flags = array();

/**
* Columns that return arrays. Will be decoded.
*/
protected $arrayColumns = array(
'members' => true,
);

/**
* Columns to be fetched for sorting / filtering, will not be returned
*/
protected $extraFiltercolumns = array();

/**
* All available columns. To be overridden by specific query implementations
*/
Expand All @@ -47,6 +58,14 @@ public function getColumns()
return $this->columns;
}

/**
* Whether the named columns value is generated by a filter expression
*/
public function isFilterFlag($column)
{
return array_key_exists($column, $this->filter_flags);
}

/**
* Parse the given encoded array
*
Expand Down

0 comments on commit 628597d

Please sign in to comment.