Skip to content

Commit

Permalink
Add orderBy to ospf module db dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant committed Sep 23, 2024
1 parent 15607e0 commit 0400fd7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions LibreNMS/Modules/Ospf.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,17 @@ public function dump(Device $device, string $type): ?array
'ospf_ports' => $device->ospfPorts()
->leftJoin('ports', 'ospf_ports.port_id', 'ports.port_id')
->select(['ospf_ports.*', 'ifIndex'])
->orderBy('ospf_port_id')->orderBy('context_name')
->get()->map->makeHidden(['id', 'device_id', 'port_id']),
'ospf_instances' => $device->ospfInstances->map->makeHidden(['id', 'device_id']),
'ospf_areas' => $device->ospfAreas->map->makeHidden(['id', 'device_id']),
'ospf_nbrs' => $device->ospfNbrs->map->makeHidden(['id', 'device_id']),
'ospf_instances' => $device->ospfInstances()
->orderBy('ospf_instance_id')->orderBy('context_name')
->get()->map->makeHidden(['id', 'device_id']),
'ospf_areas' => $device->ospfAreas()
->orderBy('ospfAreaId')->orderBy('context_name')
->get()->map->makeHidden(['id', 'device_id']),
'ospf_nbrs' => $device->ospfNbrs()
->orderBy('ospf_nbr_id')->orderBy('context_name')
->get()->map->makeHidden(['id', 'device_id']),
];
}
}

0 comments on commit 0400fd7

Please sign in to comment.