mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Exporter: services should be an array
This commit is contained in:
parent
d6bec9bfe1
commit
21d913e232
@ -152,10 +152,10 @@ class Exporter
|
||||
throw new RuntimeException('Not yet');
|
||||
}
|
||||
$props['services'] = [];
|
||||
foreach ($object->getServiceObjects() as $serviceObject) {
|
||||
$props['services'][$serviceObject->getObjectName()] = $this->export($serviceObject);
|
||||
foreach ($object->getServices() as $serviceObject) {
|
||||
$props['services'][] = $this->export($serviceObject);
|
||||
}
|
||||
ksort($props['services']);
|
||||
usort($props['services'], [$this, 'sortByName']);
|
||||
} elseif ($object instanceof IcingaHost) {
|
||||
if ($this->exportHostServices) {
|
||||
$services = [];
|
||||
@ -168,6 +168,11 @@ class Exporter
|
||||
}
|
||||
}
|
||||
|
||||
protected function sortByName($left, $right)
|
||||
{
|
||||
return $left->object_name < $right->object_name ? '-1' : '1';
|
||||
}
|
||||
|
||||
public function serviceLoader()
|
||||
{
|
||||
if ($this->serviceLoader === null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user