mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
CompareBasketObject::sortListBy() -> support array
This commit is contained in:
parent
70a822f270
commit
df10d6a924
@ -46,7 +46,11 @@ class CompareBasketObject
|
||||
protected static function sortListBy($key, &$list)
|
||||
{
|
||||
usort($list, function ($a, $b) use ($key) {
|
||||
return $a->$key > $b->$key ? -1 : 1;
|
||||
if (is_array($a)) {
|
||||
return $a[$key] > $b[$key] ? -1 : 1;
|
||||
} else {
|
||||
return $a->$key > $b->$key ? -1 : 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user