Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
watchtable.php
1
<?php
2
3
namespace
Bitrix\Pull\Model
;
4
5
use
Bitrix\Main\ORM
;
6
23
class
WatchTable
extends
ORM\Data\DataManager
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
}
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Pull\Model\WatchTable
Definition
watchtable.php:24
Bitrix\Pull\Model\WatchTable\getMap
static getMap()
Definition
watchtable.php:30
Bitrix\Pull\Model\WatchTable\getUserIdsByTag
static getUserIdsByTag(string $tag)
Definition
watchtable.php:49
Bitrix\Pull\Model\WatchTable\getTableName
static getTableName()
Definition
watchtable.php:25
Bitrix\Main\ORM
Bitrix\Pull\Model
Definition
channel.php:3
modules
pull
lib
model
watchtable.php
Создано системой
1.10.0