1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
OtherUsersStage.php
См. документацию.
1<?php
2
4
8use Bitrix\Im\V2\Recent\Initializer\StageType;
10
12{
13 public static function getType(): StageType
14 {
15 return StageType::Other;
16 }
17
18 protected function getPullRecipients(array $items): array
19 {
20 return array_map(static fn (array $item) => $item['USER_ID'], $items);
21 }
22
23 protected function getPullParams(array $items): array
24 {
25 return [
26 'items' => [
27 [
28 'user' => User::getInstance($this->targetId)->toRestFormat(['WITHOUT_ONLINE' => true]),
29 'date' => new DateTime(),
30 ]
31 ]
32 ];
33 }
34
35 protected function getUsersWithExistingItems(array $users): array
36 {
37 if (empty($users))
38 {
39 return [];
40 }
41
42 $result = [];
43 $raw = RecentTable::query()
44 ->setSelect(['USER_ID'])
45 ->whereIn('USER_ID', $users)
46 ->where('ITEM_TYPE', 'P')
47 ->where('ITEM_ID', $this->targetId)
48 ->fetchAll()
49 ;
50
51 foreach ($raw as $row)
52 {
53 $id = (int)($row['USER_ID'] ?? 0);
54 $result[$id] = $id;
55 }
56
57 return $result;
58 }
59
60 protected function getItemByTargetAndUser(int $targetUserId, int $otherUserId): array
61 {
62 return $this->getItem($otherUserId, $targetUserId);
63 }
64}
static getInstance($userId=null)
Определения user.php:45
getItem(int $userId, int $itemId)
Определения BaseStage.php:118
getItemByTargetAndUser(int $targetUserId, int $otherUserId)
Определения OtherUsersStage.php:60
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$items
Определения template.php:224