30 $idsUsersWithoutOnlineData = [];
32 foreach ($this as $user)
34 if (!$user->isOnlineDataFilled($withStatus))
36 $idsUsersWithoutOnlineData[] = $user->getId();
40 $idsUsersWithoutOnlineData = array_unique($idsUsersWithoutOnlineData);
42 if (empty($idsUsersWithoutOnlineData))
48 $query = UserTable::query()
50 ->whereIn(
'ID', $idsUsersWithoutOnlineData)
54 $query->registerRuntimeField(
58 Join::on(
'this.ID',
'ref.USER_ID'),
59 [
'join_type' => Join::TYPE_LEFT]
63 $statusesData = $query->fetchAll() ?: [];
65 foreach ($statusesData as $statusData)
67 $this->
getById((
int)$statusData[
'USER_ID'])->setOnlineData($statusData, $withStatus);