1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
error.php
См. документацию.
1<?php
2namespace Bitrix\Landing;
3
4class Error
5{
10 protected array $errors = array();
11
18 public function addError($code, $message= '')
19 {
20 $this->errors[] = new \Bitrix\Main\Error($message != '' ? $message : $code, $code);
21 }
22
29 {
30 foreach ($error->getErrors() as $err)
31 {
32 $this->errors[] = $err;
33 }
34 }
35
40 public function getFirstError(): ?\Bitrix\Main\Error
41 {
42 if ($this->errors)
43 {
44 $errors = array_values($this->errors);
45 return array_shift($errors);
46 }
47
48 return null;
49 }
50
55 public function getErrors()
56 {
57 return $this->errors;
58 }
59
64 public function isEmpty()
65 {
66 return empty($this->errors);
67 }
68
74 public function addFromResult($result)
75 {
76 if (
77 (
78 $result instanceof \Bitrix\Main\Result ||
79 $result instanceof \Bitrix\Main\Entity\AddResult ||
82 ) && !$result->isSuccess()
83 )
84 {
85 foreach ($result->getErrors() as $error)
86 {
87 $this->addError(
88 $error->getCode(),
89 $error->getMessage()
90 );
91 }
92 }
93 }
94}
array $errors
Определения error.php:10
getFirstError()
Определения error.php:40
addFromResult($result)
Определения error.php:74
getErrors()
Определения error.php:55
copyError(\Bitrix\Landing\Error $error)
Определения error.php:28
isEmpty()
Определения error.php:64
addError($code, $message='')
Определения error.php:18
Определения result.php:20
Определения error.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$errors
Определения iblock_catalog_edit.php:74
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
Определения agent.php:3
Определения ufield.php:9
$message
Определения payment.php:8
$error
Определения subscription_card_product.php:20