[icinga-checkins] icinga.org: icingaweb2-module-director/master: SuggestController: temporarily add locations

git at icinga.org git at icinga.org
Wed Dec 7 09:58:49 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 87bd531f2addc13706c981f883490052135ce9db
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=87bd531f2addc13706c981f883490052135ce9db

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Dec  7 08:26:15 2016 +0100

SuggestController: temporarily add locations

---

 application/controllers/SuggestController.php |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/application/controllers/SuggestController.php b/application/controllers/SuggestController.php
index cf264d0..b9eb2ab 100644
--- a/application/controllers/SuggestController.php
+++ b/application/controllers/SuggestController.php
@@ -61,6 +61,24 @@ class SuggestController extends ActionController
         $this->view->suggestions = $suggestions;
     }
 
+    /**
+     * One more dummy helper for tests
+     *
+     * TODO: Should not remain here
+     *
+     * @return array
+     */
+    protected function suggestLocations()
+    {
+        $db = $this->db()->getDbAdapter();
+        $query = $db->select()
+            ->distinct()
+            ->from('icinga_host_var', 'varvalue')
+            ->where('varname = ?', 'location')
+            ->order('varvalue');
+        return $db->fetchCol($query);
+    }
+
     protected function suggestHostnames()
     {
         $db = $this->db()->getDbAdapter();



More information about the icinga-checkins mailing list