From 18882324ee1ef4abfe2aed6180c68d849871bbe9 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 13 Oct 2016 09:20:39 +0000 Subject: [PATCH] ShowController: let the object provide the config --- application/controllers/ShowController.php | 25 ++-------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/application/controllers/ShowController.php b/application/controllers/ShowController.php index 87e6ce78..87f62c81 100644 --- a/application/controllers/ShowController.php +++ b/application/controllers/ShowController.php @@ -75,35 +75,14 @@ class ShowController extends ActionController return $tabs; } - protected function getObjectConfig($object) - { - $config = new IcingaConfig($this->db()); - if ($object->isExternal()) { - $object->object_type = 'object'; - } - - try { - $object->renderToConfig($config); - } catch (Exception $e) { - $config->configFile( - 'failed-to-render' - )->prepend( - "/** Failed to render this object **/\n" - . '/* ' . $e->getMessage() . ' */' - ); - } - - return $config; - } - protected function newConfig($entry) { - return $this->getObjectConfig($this->newObject($entry)); + return $this->newObject($entry)->toSingleIcingaConfig(); } protected function oldConfig($entry) { - return $this->getObjectConfig($this->oldObject($entry)); + return $this->oldObject($entry)->toSingleIcingaConfig(); } protected function showDiff($entry)