mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
Db: split fetchTemplateTree() logic
This commit is contained in:
parent
b2f10764c9
commit
34c550f4bc
@ -85,7 +85,7 @@ class Db extends DbConnection
|
||||
return $db->fetchOne($query);
|
||||
}
|
||||
|
||||
public function fetchTemplateTree($type)
|
||||
protected function fetchTemplateRelations($type)
|
||||
{
|
||||
$db = $this->db();
|
||||
$query = $db->select()->from(
|
||||
@ -106,7 +106,12 @@ class Db extends DbConnection
|
||||
->order('p.object_name')
|
||||
->order('o.object_name');
|
||||
|
||||
$relations = $db->fetchAll($query);
|
||||
return $db->fetchAll($query);
|
||||
}
|
||||
|
||||
public function fetchTemplateTree($type)
|
||||
{
|
||||
$relations = $this->fetchTemplateRelations($type);
|
||||
$children = array();
|
||||
$objects = array();
|
||||
foreach ($relations as $rel) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user