7use Bitrix\Im\V2\Common\ActiveRecordImplementation;
8use Bitrix\Im\V2\Common\ContextCustomer;
9use Bitrix\Im\V2\Common\FieldAccessImplementation;
10use Bitrix\Im\V2\Common\RegistryEntryImplementation;
16 use FieldAccessImplementation;
17 use ActiveRecordImplementation;
18 use RegistryEntryImplementation;
21 protected ?
int $id =
null;
42 $this->initByDefault();
52 return $this->
getId();
57 return $this->
setId($primaryId);
62 return RelationTable::class;
67 if (isset($this->user))
87 ->setStartId($chat->getLastMessageId() + 1)
88 ->setLastFileId($chat->getLastFileId())
93 if (!$hideHistory && $chat->getContext()->getUserId() > 0)
95 $selfRelation = $chat->getSelfRelation();
96 if ($selfRelation !==
null && $selfRelation->getStartId() > 0)
99 ->setStartCounter($selfRelation->getStartId())
100 ->setLastFileId($selfRelation->getLastFileId())
101 ->setStartCounter($selfRelation->getStartCounter())
123 'set' =>
'setChatId',
124 'get' =>
'getChatId',
127 'field' =>
'messageType',
128 'set' =>
'setMessageType',
129 'get' =>
'getMessageType',
133 'set' =>
'setUserId',
134 'get' =>
'getUserId',
137 'field' =>
'startId',
138 'set' =>
'setStartId',
139 'get' =>
'getStartId',
142 'field' =>
'unreadId',
143 'set' =>
'setUnreadId',
144 'get' =>
'getUnreadId',
148 'set' =>
'setLastId',
149 'get' =>
'getLastId',
152 'field' =>
'lastSendId',
153 'set' =>
'setLastSendId',
154 'get' =>
'getLastSendId',
157 'field' =>
'lastFileId',
158 'set' =>
'setLastFileId',
159 'get' =>
'getLastFileId',
162 'field' =>
'lastRead',
163 'set' =>
'setLastReadInternal',
164 'get' =>
'getLastRead',
168 'set' =>
'setStatus',
169 'get' =>
'getStatus',
172 'field' =>
'callStatus',
173 'set' =>
'setCallStatus',
174 'get' =>
'getCallStatus',
176 'MESSAGE_STATUS' => [
177 'field' =>
'messageStatus',
178 'set' =>
'setMessageStatus',
179 'get' =>
'getMessageStatus',
182 'field' =>
'notifyBlock',
183 'set' =>
'setNotifyBlock',
184 'get' =>
'getNotifyBlock',
187 'field' =>
'manager',
188 'set' =>
'setManager',
189 'get' =>
'getManager',
192 'field' =>
'counter',
193 'set' =>
'setCounter',
194 'get' =>
'getCounter',
197 'field' =>
'startCounter',
198 'set' =>
'setStartCounter',
199 'get' =>
'getStartCounter',
318 $lastReadDateTime =
null;
static getMessageCount($chatId, $userId=null)
static getInstance($userId=null)
setPrimaryId(int $primaryId)
setMessageStatus(?string $messageStatus)
setManager(?bool $manager)
setLastRead(?DateTime $lastRead)
setMessageType(?string $messageType)
setLastSendId(?int $lastSendId)
setStartId(?int $startId)
__construct($source=null)
setNotifyBlock(?bool $notifyBlock)
setStartCounter(?int $startCounter)
setCounter(?int $counter)
setLastFileId(?int $lastFileId)
setCallStatus(?int $callStatus)
setUnreadId(?int $unreadId)
fillRestriction(bool $hideHistory, Chat $chat)
static mirrorDataEntityFields()
static tryParse($timeString, $format=null)