[icinga-checkins] icinga.org: icingaweb2-module-director/feature/nested-apply-rules-12033: IcingaService: introduce assign_filter property

git at icinga.org git at icinga.org
Fri Oct 21 20:23:39 CEST 2016


Module: icingaweb2-module-director
Branch: feature/nested-apply-rules-12033
Commit: 23097a5bd5475adf94bca35bddd2bf08fa0cbf79
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=23097a5bd5475adf94bca35bddd2bf08fa0cbf79

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Oct 21 18:19:47 2016 +0000

IcingaService: introduce assign_filter property

---

 library/Director/Objects/IcingaService.php |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php
index 31eecb4..ab45312 100644
--- a/library/Director/Objects/IcingaService.php
+++ b/library/Director/Objects/IcingaService.php
@@ -2,6 +2,7 @@
 
 namespace Icinga\Module\Director\Objects;
 
+use Icinga\Data\Filter\Filter;
 use Icinga\Exception\ProgrammingError;
 use Icinga\Module\Director\IcingaConfig\IcingaConfig;
 use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c;
@@ -40,6 +41,7 @@ class IcingaService extends IcingaObject
         'icon_image_alt'        => null,
         'use_agent'             => null,
         'use_var_overrides'     => null,
+        'assign_filter'         => null,
     );
 
     protected $relations = array(
@@ -108,6 +110,19 @@ class IcingaService extends IcingaObject
         return $this->use_var_overrides === 'y';
     }
 
+    /**
+     * @codingStandardsIgnoreStart
+     */
+    public function setAssign_filter($filter)
+    {
+        // @codingStandardsIgnoreEnd
+        if ($filter instanceof Filter) {
+            $filter = $filter->toQueryString();
+        }
+
+        return $this->reallySet('assign_filter', $filter);
+    }
+
     protected function setKey($key)
     {
         if (is_int($key)) {



More information about the icinga-checkins mailing list