[icinga-checkins] icinga.org: icingaweb2-module-director/feature/icinga1-config-12919: IcingaObject(Legacy): Add getLegacyObjectType function

git at icinga.org git at icinga.org
Wed Oct 19 13:17:42 CEST 2016


Module: icingaweb2-module-director
Branch: feature/icinga1-config-12919
Commit: 66374d02275fc22d7aa1cc4d90782051bd680a06
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=66374d02275fc22d7aa1cc4d90782051bd680a06

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Fri Oct 14 10:07:17 2016 +0200

IcingaObject(Legacy): Add getLegacyObjectType function

So the type rendered to the object header can get overwritten.

refs #12919

---

 library/Director/Objects/IcingaObject.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index bd3a087..521eadc 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1893,9 +1893,14 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         }
     }
 
+    protected function getLegacyObjectType()
+    {
+        return strtolower($this->getType());
+    }
+
     protected function renderLegacyObjectHeader()
     {
-        $type = strtolower($this->getType());
+        $type = $this->getLegacyObjectType();
 
         if ($this->isTemplate()) {
             $name = c1::renderKeyValue(



More information about the icinga-checkins mailing list