From 628597d6cb60a919a59d6c02da1331215f239ceb Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 16 Nov 2014 16:32:53 +0100 Subject: [PATCH] Livestatus\Query: some more filter-related stuff --- library/Icinga/Protocol/Livestatus/Query.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/library/Icinga/Protocol/Livestatus/Query.php b/library/Icinga/Protocol/Livestatus/Query.php index b01cd5f92..b3c3e89ad 100644 --- a/library/Icinga/Protocol/Livestatus/Query.php +++ b/library/Icinga/Protocol/Livestatus/Query.php @@ -18,6 +18,12 @@ 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. */ @@ -25,6 +31,11 @@ class Query extends SimpleQuery '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 */ @@ -47,6 +58,14 @@ class Query extends SimpleQuery 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 *