1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
CounterType.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Message\Counter;
4
5use Bitrix\Im\V2\Chat;
6
7enum CounterType: string
8{
9 case Chat = 'chat';
10 case Comment = 'comment';
11 case Copilot = 'copilot';
12 case Openline = 'openline';
13 case Collab = 'collab';
14
15 public static function tryFromType(?string $type): self
16 {
17 return match ($type)
18 {
19 Chat::IM_TYPE_COMMENT => self::Comment,
20 Chat::IM_TYPE_OPEN_LINE => self::Openline,
21 Chat::IM_TYPE_COPILOT => self::Copilot,
22 Chat::IM_TYPE_COLLAB => self::Collab,
23 default => self::Chat,
24 };
25 }
26
27 public static function tryFromChat(Chat $chat): self
28 {
29 return self::tryFromType($chat->getType());
30 }
31}
$type
Определения options.php:106
static getType($chatData, bool $camelCase=true)
Определения chat.php:45