[icinga-checkins] icinga.org: icingaweb2-module-director/master: ImportRun: allow to fetch specific keys

git at icinga.org git at icinga.org
Thu Jul 14 12:53:59 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Jul 13 21:37:31 2016 +0200

ImportRun: allow to fetch specific keys

---

 library/Director/Objects/ImportRun.php |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/ImportRun.php b/library/Director/Objects/ImportRun.php
index 3994997..f339c2c 100644
--- a/library/Director/Objects/ImportRun.php
+++ b/library/Director/Objects/ImportRun.php
@@ -57,7 +57,7 @@ class ImportRun extends DbObject
         return $db->fetchCol($query);
     }
 
-    public function fetchRows($columns, $filter = null)
+    public function fetchRows($columns, $filter = null, $keys = null)
     {
         $db = $this->getDb();
         $binchecksum = $this->rowset_checksum;
@@ -96,6 +96,10 @@ class ImportRun extends DbObject
             $empty->$k = null;
         }
 
+        if ($keys !== null) {
+            $query->where('r.object_name IN (?)', $keys);
+        }
+
         foreach ($db->fetchAll($query) as $row) {
             if (! array_key_exists($row->object_name, $result)) {
                 $result[$row->object_name] = clone($empty);



More information about the icinga-checkins mailing list