Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
reaction.php
1
<?php
2
namespace
Bitrix\Im\Model
;
3
4
use
Bitrix\Main\ORM\Data\DataManager
;
5
use Bitrix\Main\ORM\Data\Internal\DeleteByFilterTrait;
6
use
Bitrix\Main\ORM\Fields\DatetimeField
;
7
use
Bitrix\Main\ORM\Fields\ExpressionField
;
8
use
Bitrix\Main\ORM\Fields\IntegerField
;
9
use
Bitrix\Main\ORM\Fields\StringField
;
10
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
11
41
class
ReactionTable
extends
DataManager
42
{
43
use DeleteByFilterTrait;
44
50
public
static
function
getTableName
()
51
{
52
return
'b_im_reaction'
;
53
}
54
60
public
static
function
getMap
()
61
{
62
return
[
63
'ID'
=>
new
IntegerField
(
64
'ID'
,
65
[
66
'primary'
=>
true
,
67
'autocomplete'
=>
true
,
68
]
69
),
70
'CHAT_ID'
=>
new
IntegerField
(
71
'CHAT_ID'
,
72
[
73
'required'
=>
true
,
74
]
75
),
76
'MESSAGE_ID'
=>
new
IntegerField
(
77
'MESSAGE_ID'
,
78
[
79
'required'
=>
true
,
80
]
81
),
82
'USER_ID'
=>
new
IntegerField
(
83
'USER_ID'
,
84
[
85
'required'
=>
true
,
86
]
87
),
88
'REACTION'
=>
new
StringField
(
89
'REACTION'
,
90
[
91
'required'
=>
true
,
92
'validation'
=> [__CLASS__,
'validateReaction'
],
93
]
94
),
95
'DATE_CREATE'
=>
new
DatetimeField
(
96
'DATE_CREATE'
,
97
[
98
'required'
=>
true
,
99
]
100
),
101
'COUNT'
=> (
new
ExpressionField
(
102
'COUNT'
,
103
'COUNT(*)'
104
))->configureValueType(IntegerField::class),
105
];
106
}
107
113
public
static
function
validateReaction
(): array
114
{
115
return
[
116
new
LengthValidator
(
null
, 50),
117
];
118
}
119
}
Bitrix\Im\Model\ReactionTable
Definition
reaction.php:42
Bitrix\Im\Model\ReactionTable\getMap
static getMap()
Definition
reaction.php:60
Bitrix\Im\Model\ReactionTable\validateReaction
static validateReaction()
Definition
reaction.php:113
Bitrix\Im\Model\ReactionTable\getTableName
static getTableName()
Definition
reaction.php:50
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\ExpressionField
Definition
expressionfield.php:25
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Im\Model
Definition
alias.php:2
modules
im
lib
model
reaction.php
Создано системой
1.10.0