Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
StatusResolver.php
1
<?php
2
3
namespace
Bitrix\MessageService\Providers\Edna\WhatsApp
;
4
5
use
Bitrix\MessageService\MessageStatus
;
6
7
class
StatusResolver
implements
\Bitrix\MessageService\Providers\StatusResolver
8
{
9
10
public
function
resolveStatus
(
string
$serviceStatus): ?int
11
{
12
$serviceStatus = mb_strtolower($serviceStatus);
13
switch
($serviceStatus)
14
{
15
case
'read'
:
16
return
MessageStatus::READ
;
17
case
'sent'
:
18
return
MessageStatus::SENT
;
19
case
'enqueued'
:
20
return
MessageStatus::QUEUED
;
21
case
'delayed'
:
22
return
MessageStatus::ACCEPTED
;
23
case
'delivered'
:
24
return
MessageStatus::DELIVERED
;
25
case
'undelivered'
:
26
return
MessageStatus::UNDELIVERED
;
27
case
'failed'
:
28
case
'cancelled'
:
29
case
'expired'
:
30
case
'no-match-template'
:
31
return
MessageStatus::FAILED
;
32
default
:
33
return
mb_strpos($serviceStatus,
'error'
) === 0 ?
MessageStatus::ERROR
:
MessageStatus::UNKNOWN
;
34
}
35
}
36
}
Bitrix\MessageService\MessageStatus
Definition
messagestatus.php:9
Bitrix\MessageService\MessageStatus\SENT
const SENT
Definition
messagestatus.php:20
Bitrix\MessageService\MessageStatus\FAILED
const FAILED
Definition
messagestatus.php:23
Bitrix\MessageService\MessageStatus\ERROR
const ERROR
Definition
messagestatus.php:12
Bitrix\MessageService\MessageStatus\QUEUED
const QUEUED
Definition
messagestatus.php:18
Bitrix\MessageService\MessageStatus\ACCEPTED
const ACCEPTED
Definition
messagestatus.php:17
Bitrix\MessageService\MessageStatus\UNDELIVERED
const UNDELIVERED
Definition
messagestatus.php:22
Bitrix\MessageService\MessageStatus\DELIVERED
const DELIVERED
Definition
messagestatus.php:21
Bitrix\MessageService\MessageStatus\READ
const READ
Definition
messagestatus.php:24
Bitrix\MessageService\MessageStatus\UNKNOWN
const UNKNOWN
Definition
messagestatus.php:26
Bitrix\MessageService\Providers\Edna\WhatsApp\StatusResolver
Definition
StatusResolver.php:8
Bitrix\MessageService\Providers\Edna\WhatsApp\StatusResolver\resolveStatus
resolveStatus(string $serviceStatus)
Definition
StatusResolver.php:10
Bitrix\MessageService\Providers\StatusResolver
Definition
StatusResolver.php:6
Bitrix\MessageService\Providers\Edna\WhatsApp
Definition
ConnectorLine.php:3
modules
messageservice
lib
Providers
Edna
WhatsApp
StatusResolver.php
Создано системой
1.10.0