Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
messageviewed.php
1<?php
2namespace Bitrix\Im\Model;
3
4use Bitrix\Im\V2\Common\InsertSelectTrait;
5use Bitrix\Im\V2\Common\MultiplyInsertTrait;
7use Bitrix\Main\ORM\Data\Internal\DeleteByFilterTrait;
8use Bitrix\Main\ORM\Data\Internal\MergeTrait;
14
45{
46 use MultiplyInsertTrait;
47 use MergeTrait;
48 use InsertSelectTrait;
49 use DeleteByFilterTrait;
50
56 public static function getTableName()
57 {
58 return 'b_im_message_viewed';
59 }
60
66 public static function getMap()
67 {
68 return [
69 'ID' => new IntegerField(
70 'ID',
71 [
72 'primary' => true,
73 'autocomplete' => true,
74 ]
75 ),
76 'USER_ID' => new IntegerField(
77 'USER_ID',
78 [
79 'required' => true,
80 ]
81 ),
82 'CHAT_ID' => new IntegerField(
83 'CHAT_ID',
84 [
85 'required' => true,
86 ]
87 ),
88 'MESSAGE_ID' => new IntegerField(
89 'MESSAGE_ID',
90 [
91 'required' => true,
92 ]
93 ),
94 'DATE_CREATE' => new DatetimeField(
95 'DATE_CREATE',
96 [
97 'default' => function()
98 {
99 return new DateTime();
100 },
101 ]
102 ),
103 ];
104 }
105
111 public static function validateReaction(): array
112 {
113 return [
114 new LengthValidator(null, 50),
115 ];
116 }
117}