1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Error.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2;
4
5use Bitrix\Main\Localization\Loc;
6
8{
9 public const NOT_FOUND = 'NOT_FOUND';
10 public const PULL_NOT_INSTALLED = 'PULL_NOT_INSTALLED';
11
12 protected string $description = '';
13
14 public function __construct(string $code, ...$args)
15 {
16 $message = null;
17 $description = null;
18 $customData = [];
19
20 if (!empty($args))
21 {
22 $message = isset($args[0]) && is_string($args[0]) ? $args[0] : null;
23 $description = isset($args[1]) && is_string($args[1]) ? $args[1] : null;
24 $inx = count($args) - 1;
25 $customData = isset($args[$inx]) && is_array($args[$inx]) ? $args[$inx] : [];
26 }
27
28 $replacements = [];
29 foreach ($customData as $key => $value)
30 {
31 $replacements["#{$key}#"] = $value;
32 }
33
34 if (!is_string($message))
35 {
36 $message = $this->loadErrorMessage($code, $replacements);
37 }
38
39 if (is_string($message) && mb_strlen($message) > 0 && !is_string($description))
40 {
41 $description = $this->loadErrorDescription($code, $replacements);
42 }
43
44 if (!is_string($message) || mb_strlen($message) === 0)
45 {
47 }
48
49 parent::__construct($message, $code, $customData);
50
51 if (is_string($description))
52 {
54 }
55 }
56
57 public function getDescription(): string
58 {
59 return $this->description;
60 }
61
62 public function setDescription(string $description): void
63 {
64 $this->description = $description;
65 }
66
67 protected function loadErrorMessage($code, $replacements): string
68 {
69 return Loc::getMessage("ERROR_{$code}", $replacements) ?? '';
70 }
71
72 protected function loadErrorDescription($code, $replacements): string
73 {
74 return Loc::getMessage("ERROR_{$code}_DESC", $replacements) ?? '';
75 }
76}
string $description
Определения Error.php:12
getDescription()
Определения Error.php:57
setDescription(string $description)
Определения Error.php:62
const NOT_FOUND
Определения Error.php:9
__construct(string $code,... $args)
Определения Error.php:14
loadErrorMessage($code, $replacements)
Определения Error.php:67
const PULL_NOT_INSTALLED
Определения Error.php:10
loadErrorDescription($code, $replacements)
Определения Error.php:72
Определения error.php:15
$code
Определения error.php:17
$message
Определения error.php:20
$customData
Определения error.php:24
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
Определения .description.php:24
if(empty($signedUserToken)) $key
Определения quickway.php:257
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936