Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
watchtable.php
1<?php
2
3namespace Bitrix\Pull\Model;
4
6
24{
25 public static function getTableName(): string
26 {
27 return 'b_pull_watch';
28 }
29
30 public static function getMap(): array
31 {
32 return [
33 (new ORM\Fields\IntegerField('ID'))
34 ->configurePrimary()
35 ->configureAutocomplete(),
36 (new ORM\Fields\IntegerField('USER_ID'))
37 ->configureRequired(),
38 (new ORM\Fields\StringField('CHANNEL_ID'))
39 ->configureRequired()
40 ->configureSize(50),
41 (new ORM\Fields\StringField('TAG'))
42 ->configureRequired()
43 ->configureSize(255),
44 (new ORM\Fields\DatetimeField('DATE_CREATE'))
45 ->configureRequired(),
46 ];
47 }
48
49 public static function getUserIdsByTag(string $tag): array
50 {
51 $userIds = [];
52
53 $list = static::getList([
54 'select' => ['USER_ID'],
55 'filter' => [
56 '=TAG' => $tag,
57 ],
58 ]);
59 while($record = $list->fetch())
60 {
61 $record['USER_ID'] = (int)$record['USER_ID'];
62 $userIds[$record['USER_ID']] = $record['USER_ID'];
63 }
64
65 return $userIds;
66 }
67}
static getUserIdsByTag(string $tag)