IcingaTemplateResolver: separate concerns...

...and make helper accessible
This commit is contained in:
Thomas Gelf 2017-01-13 15:20:04 +01:00
parent 4a75804d86
commit 40ff51e487
1 changed files with 6 additions and 2 deletions

View File

@ -223,9 +223,13 @@ class IcingaTemplateResolver
public function listInheritancePathIds($objectId = null) public function listInheritancePathIds($objectId = null)
{ {
$full = $this->listFullInheritancePathIds($objectId); return $this->uniquePathIds($this->listFullInheritancePathIds($objectId));
}
public function uniquePathIds(array $ids)
{
$single = array(); $single = array();
foreach (array_reverse($full) as $id) { foreach (array_reverse($ids) as $id) {
if (array_key_exists($id, $single)) { if (array_key_exists($id, $single)) {
continue; continue;
} }