1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ChatService.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Onboarding\Integration\Im;
6
7use Bitrix\Im\V2\MessageCollection;
8use Bitrix\Main\Loader;
9use Bitrix\Main\Type\DateTime;
10use Bitrix\Socialnetwork\Helper\InstanceTrait;
11
13{
14 use InstanceTrait;
15
16 private function __construct()
17 {
18 }
19
20 public function isExistUserMessageByPeriod(int $chatId, DateTime $from, DateTime $to): bool
21 {
22 if (!Loader::includeModule('im'))
23 {
24 return false;
25 }
26
27 $messages = MessageCollection::find(
28 [
29 'CHAT_ID' => $chatId,
30 'DATE_FROM' => $from,
31 'DATE_TO' => $to,
32 'WITHOUT_SYSTEM_MESSAGE' => true,
33 ],
34 ['ID' => 'ASC'],
35 1,
36 null,
37 ['ID'],
38 );
39
40 return !$messages->isEmpty();
41 }
42}
isExistUserMessageByPeriod(int $chatId, DateTime $from, DateTime $to)
Определения ChatService.php:20
$messages
Определения template.php:8