[icinga-checkins] icinga.org: icingaweb2-module-director/master: ImportRun: Add access to ImportSource

git at icinga.org git at icinga.org
Fri Nov 11 11:32:57 CET 2016


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

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Wed Nov  9 14:20:35 2016 +0100

ImportRun: Add access to ImportSource

---

 library/Director/Objects/ImportRun.php |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/library/Director/Objects/ImportRun.php b/library/Director/Objects/ImportRun.php
index f339c2c..2bef325 100644
--- a/library/Director/Objects/ImportRun.php
+++ b/library/Director/Objects/ImportRun.php
@@ -12,6 +12,9 @@ class ImportRun extends DbObject
 
     protected $autoincKeyName = 'id';
 
+    /** @var ImportSource */
+    protected $importSource = null;
+
     protected $defaultProperties = array(
         'id'              => null,
         'source_id'       => null,
@@ -125,4 +128,12 @@ class ImportRun extends DbObject
 
         return $result;
     }
+
+    public function importSource()
+    {
+        if ($this->importSource === null) {
+            $this->importSource = ImportSource::load($this->get('source_id'), $this->connection);
+        }
+        return $this->importSource;
+    }
 }



More information about the icinga-checkins mailing list