Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
messagestatus.php
1<?php
3
5
6Loc::loadMessages(__FILE__);
7
9{
10 //local queue statuses
11 public const PENDING = 0;
12 public const ERROR = 1;
13 public const EXCEPTION = 2;
14 public const DEFERRED = 3;
15
16 //external service statuses
17 public const ACCEPTED = 10;
18 public const QUEUED = 11;
19 public const SENDING = 12;
20 public const SENT = 13;
21 public const DELIVERED = 14;
22 public const UNDELIVERED = 15;
23 public const FAILED = 16;
24 public const READ = 17;
25
26 public const UNKNOWN = 64;
27
28 public const SEMANTIC_PROCESS = 'process';
29 public const SEMANTIC_SUCCESS = 'success';
30 public const SEMANTIC_FAILURE = 'failure';
31
32 public static function getDescriptions(?string $language = null): array
33 {
34 return [
35 static::PENDING => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_SENDING', null, $language),
36 static::ERROR => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_ERROR', null, $language),
37 static::EXCEPTION => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_EXCEPTION', null, $language),
38 static::DEFERRED => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_DEFERRED',null, $language),
39
40 static::ACCEPTED => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_SENDING', null, $language),
41 static::QUEUED => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_SENDING', null, $language),
42 static::SENDING => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_SENDING', null, $language),
43 static::SENT => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_SENT', null, $language),
44 static::DELIVERED => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_DELIVERED', null, $language),
45 static::UNDELIVERED => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_UNDELIVERED', null, $language),
46 static::FAILED => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_FAILED', null, $language),
47 static::READ => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_READ', null, $language),
48 static::UNKNOWN => Loc::getMessage('MESSAGESERVICE_MESSAGESTATUS_SENDING', null, $language),
49 ];
50 }
51
52 public static function getSemantics(): array
53 {
54 return [
55 static::PENDING => static::SEMANTIC_PROCESS,
56 static::ERROR => static::SEMANTIC_FAILURE,
57 static::EXCEPTION => static::SEMANTIC_FAILURE,
58 static::DEFERRED => static::SEMANTIC_PROCESS,
59
60 static::ACCEPTED => static::SEMANTIC_PROCESS,
61 static::QUEUED => static::SEMANTIC_PROCESS,
62 static::SENDING => static::SEMANTIC_PROCESS,
63 static::SENT => static::SEMANTIC_SUCCESS,
64 static::DELIVERED => static::SEMANTIC_SUCCESS,
65 static::UNDELIVERED => static::SEMANTIC_FAILURE,
66 static::FAILED => static::SEMANTIC_FAILURE,
67 static::READ => static::SEMANTIC_SUCCESS,
68 static::UNKNOWN => static::SEMANTIC_PROCESS,
69 ];
70 }
71}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getDescriptions(?string $language=null)