[icinga-checkins] icinga.org: icingaweb2/master: FilterEditor: make constructor parameter optional

git at icinga.org git at icinga.org
Sun Nov 16 00:38:42 CET 2014


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sat Nov 15 23:02:38 2014 +0100

FilterEditor: make constructor parameter optional

...and use new setters

---

 library/Icinga/Web/Widget/FilterEditor.php |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php
index d43b276..bc82f89 100644
--- a/library/Icinga/Web/Widget/FilterEditor.php
+++ b/library/Icinga/Web/Widget/FilterEditor.php
@@ -42,9 +42,11 @@ class FilterEditor extends AbstractWidget
      */
     public function __construct($props)
     {
-        $this->filter = $props['filter'];
+        if (array_key_exists('filter', $props)) {
+            $this->setFilter($props['filter']);
+        }
         if (array_key_exists('query', $props)) {
-            $this->query = $props['query'];
+            $this->setQuery($props['query']);
         }
     }
 



More information about the icinga-checkins mailing list