[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaService: introduce assign_filter property

git at icinga.org git at icinga.org
Tue Oct 25 04:39:58 CEST 2016


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

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 3f59680..c474977 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;
@@ -41,6 +42,7 @@ class IcingaService extends IcingaObject
         'use_agent'             => null,
         'apply_for'             => null,
         'use_var_overrides'     => null,
+        'assign_filter'         => null,
     );
 
     protected $relations = array(
@@ -116,6 +118,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