|
|
@ -63,13 +63,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
public function onlyTop(int $count = RoomSieve::TOP_DEFAULT) {
|
|
|
|
public function onlyTop(int $count = RoomSieve::TOP_DEFAULT) {
|
|
|
|
$rooms = $this->rooms;
|
|
|
|
$rooms = $this->rooms;
|
|
|
|
return $this->cloneWith(array_slice(array_reverse($rooms), 0, $count));
|
|
|
|
CommunityRoom::sort_rooms_num($rooms, 'active_users', reverse: true);
|
|
|
|
|
|
|
|
return $this->cloneWith(array_slice($rooms, 0, $count));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function exceptTop(int $count = RoomSieve::TOP_DEFAULT) {
|
|
|
|
public function exceptTop(int $count = RoomSieve::TOP_DEFAULT) {
|
|
|
|
$rooms = $this->rooms;
|
|
|
|
$rooms = $this->rooms;
|
|
|
|
CommunityRoom::sort_rooms_num($rooms, 'active_users');
|
|
|
|
CommunityRoom::sort_rooms_num($rooms, 'active_users', reverse: true);
|
|
|
|
return $this->cloneWith(array_slice(array_reverse($rooms), $count));
|
|
|
|
return $this->cloneWith(array_slice($rooms, $count));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static function isIndexApproved(CommunityRoom $room): bool {
|
|
|
|
private static function isIndexApproved(CommunityRoom $room): bool {
|
|
|
|