[icinga-checkins] icinga.org: icingaweb2/feature/livestatus-playground-4787: Livestatus\StatusQuery: add terribly setMode method

git at icinga.org git at icinga.org
Sun Nov 16 17:17:18 CET 2014


Module: icingaweb2
Branch: feature/livestatus-playground-4787
Commit: 7b732158687569bef815cfb6894971a7047461a4
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=7b732158687569bef815cfb6894971a7047461a4

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sun Nov 16 15:18:10 2014 +0100

Livestatus\StatusQuery: add terribly setMode method

---

 .../Backend/Livestatus/Query/StatusQuery.php       |   23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php
index 6c7609d..d7a78fc 100644
--- a/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Livestatus/Query/StatusQuery.php
@@ -8,6 +8,29 @@ use Icinga\Protocol\Livestatus\Query;
 
 class StatusQuery extends Query
 {
+    /**
+     * This mode represents whether we are in HostStatus or ServiceStatus
+     *
+     * Implemented for `distinct as workaround
+     *
+     * @TODO Subject to change, see #7344
+     *
+     * @var string
+     */
+    protected $mode;
+
+    /**
+     * Sets the mode of the current query
+     *
+     * @TODO Subject to change, see #7344
+     *
+     * @param string $mode
+     */
+    public function setMode($mode)
+    {
+        $this->mode = $mode;
+    }
+
     protected $available_columns = array(
         'host_name',
         'host_display_name',



More information about the icinga-checkins mailing list