Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
StatusResolver.php
1
<?php
2
3
namespace
Bitrix\MessageService\Providers\Edna\SMS
;
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
case
'sent'
:
17
return
MessageStatus::SENT
;
18
case
'enqueued'
:
19
return
MessageStatus::QUEUED
;
20
case
'delayed'
:
21
return
MessageStatus::ACCEPTED
;
22
case
'delivered'
:
23
return
MessageStatus::DELIVERED
;
24
case
'undelivered'
:
25
return
MessageStatus::UNDELIVERED
;
26
case
'failed'
:
27
case
'cancelled'
:
28
return
MessageStatus::FAILED
;
29
default
:
30
return
31
mb_strpos($serviceStatus,
'error'
) === 0
32
?
MessageStatus::ERROR
33
: null
34
;
35
}
36
}
37
}
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\Providers\Edna\SMS\StatusResolver
Definition
StatusResolver.php:8
Bitrix\MessageService\Providers\Edna\SMS\StatusResolver\resolveStatus
resolveStatus(string $serviceStatus)
Definition
StatusResolver.php:10
Bitrix\MessageService\Providers\StatusResolver
Definition
StatusResolver.php:6
Bitrix\MessageService\Providers\Edna\SMS
Definition
Constants.php:3
modules
messageservice
lib
Providers
Edna
SMS
StatusResolver.php
Создано системой
1.10.0