[icinga-checkins] icinga.org: icingaweb2/master: Ido\CustomvarQuery: add is_json

git at icinga.org git at icinga.org
Thu Nov 6 16:20:21 CET 2014


Module: icingaweb2
Branch: master
Commit: 816c309193f055b771ac05f5cc52fa78d086e668
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=816c309193f055b771ac05f5cc52fa78d086e668

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Nov  6 16:14:03 2014 +0100

Ido\CustomvarQuery: add is_json

This has to be done in a backward compatible way, we check for IDO
>= 1.12.0.

refs #7569

---

 .../library/Monitoring/Backend/Ido/Query/CustomvarQuery.php       |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php
index 6a3d9a9..04e17dd 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php
@@ -10,6 +10,7 @@ class CustomvarQuery extends IdoQuery
         'customvars' => array(
             'varname'  => 'cvs.varname',
             'varvalue' => 'cvs.varvalue',
+            'is_json'  => 'cvs.is_json',
         ),
         'objects' => array(
             'host'                => 'cvo.name1 COLLATE latin1_general_ci',
@@ -37,6 +38,10 @@ class CustomvarQuery extends IdoQuery
 
     protected function joinBaseTables()
     {
+        if (version_compare($this->getIdoVersion(), '1.12.0', '<')) {
+            $this->columnMap['customvars']['is_json'] = '(0)';
+        }
+
         $this->select->from(
             array('cvs' => $this->prefix . 'customvariablestatus'),
             array()



More information about the icinga-checkins mailing list