[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: IcingaCommandArgument: add replaceWith method

git at icinga.org git at icinga.org
Thu May 19 16:46:17 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 2007dee6c0979e7aa32182ea941fc1676fa85b5d
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=2007dee6c0979e7aa32182ea941fc1676fa85b5d

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu May 19 15:09:08 2016 +0200

IcingaCommandArgument: add replaceWith method

---

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

diff --git a/library/Director/Objects/IcingaCommandArgument.php b/library/Director/Objects/IcingaCommandArgument.php
index 627a5b1..be4db15 100644
--- a/library/Director/Objects/IcingaCommandArgument.php
+++ b/library/Director/Objects/IcingaCommandArgument.php
@@ -48,6 +48,17 @@ class IcingaCommandArgument extends IcingaObject
         // No log right now, we have to handle "sub-objects"
     }
 
+    public function replaceWith(IcingaObject $object)
+    {
+        $this->setProperties((array) $object->toPlainObject(
+            false,
+            false,
+            null,
+            false
+        ));
+        return $this;
+    }
+
     public function toPlainObject(
         $resolved = false,
         $skipDefaults = false,



More information about the icinga-checkins mailing list