3namespace Bitrix\Im\V2\Entity\User;
5use Bitrix\Im\Model\StatusTable;
6use Bitrix\Im\V2\Entity\EntityCollection;
7use Bitrix\Main\ORM\Fields\Relations\Reference;
8use Bitrix\Main\ORM\Query\Join;
9use Bitrix\Main\UserTable;
20 parent::__construct();
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);
73 $filteredUserIds = [];
76 if ($limit !==
null &&
count($filteredUserIds) >= $limit)
78 return $filteredUserIds;
82 if ($predicate(
$user))
88 return $filteredUserIds;
94 $firstUserByType = static::filterUserIds($userIds,
$filter, 1);
96 return !empty($firstUserByType);
103 return parent::toRestFormat(
$option);
117 public function offsetSet($offset, $value): void
120 if (!$value->isExist())
125 parent::offsetSet($offset, $value);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
offsetSet($offset, $value)
static getRestEntityName()
toRestFormat(array $option=[])
__construct(array $usersIds=[])
fillOnlineData(bool $withStatus=false)
static hasUserByType(array $userIds, UserType $type)
static filterUserIds(array $userIds, callable $predicate, ?int $limit=null)
const ONLINE_DATA_SELECTED_FIELDS_WITHOUT_STATUS
const ONLINE_DATA_SELECTED_FIELDS
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"