From 40ff51e48734ba43d4e646affc24cede2d42b16a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 13 Jan 2017 15:20:04 +0100 Subject: [PATCH] IcingaTemplateResolver: separate concerns... ...and make helper accessible --- library/Director/Objects/IcingaTemplateResolver.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Director/Objects/IcingaTemplateResolver.php b/library/Director/Objects/IcingaTemplateResolver.php index 06f85b74..63155c7b 100644 --- a/library/Director/Objects/IcingaTemplateResolver.php +++ b/library/Director/Objects/IcingaTemplateResolver.php @@ -223,9 +223,13 @@ class IcingaTemplateResolver public function listInheritancePathIds($objectId = null) { - $full = $this->listFullInheritancePathIds($objectId); + return $this->uniquePathIds($this->listFullInheritancePathIds($objectId)); + } + + public function uniquePathIds(array $ids) + { $single = array(); - foreach (array_reverse($full) as $id) { + foreach (array_reverse($ids) as $id) { if (array_key_exists($id, $single)) { continue; }