1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
result.php
См. документацию.
1
<?php
2
9
10
namespace
Bitrix\Main;
11
12
use Bitrix\Main\DB\SqlExpression;
13
14
class
Result
15
{
17
protected
$isSuccess
=
true
;
18
19
protected
ErrorCollection
$errors
;
20
22
protected
$data
=
array
();
23
24
public
function
__construct
()
25
{
26
$this->errors =
new
ErrorCollection
();
27
}
28
29
public
function
__clone
()
30
{
31
$this->errors = clone
$this->errors
;
32
}
33
39
public
function
isSuccess
()
40
{
41
return
$this->isSuccess
;
42
}
43
50
public
function
addError
(
Error
$error
)
51
{
52
$this->
isSuccess
=
false
;
53
$this->errors[] =
$error
;
54
return
$this;
55
}
56
62
public
function
getError
(): ?
Error
63
{
64
foreach
($this->errors as
$error
)
65
{
66
return
$error
;
67
}
68
69
return
null
;
70
}
71
77
public
function
getErrors
()
78
{
79
return
$this->errors->toArray();
80
}
81
87
public
function
getErrorCollection
()
88
{
89
return
$this->errors
;
90
}
91
97
public
function
getErrorMessages
()
98
{
99
$messages
=
array
();
100
101
foreach
($this->
getErrors
() as
$error
)
102
$messages
[] =
$error
->getMessage();
103
104
return
$messages
;
105
}
106
113
public
function
addErrors
(
array
$errors
)
114
{
115
if
(
$errors
)
116
{
117
$this->
isSuccess
=
false
;
118
$this->errors->add(
$errors
);
119
}
120
return
$this;
121
}
122
128
public
function
setData
(
array
$data
)
129
{
130
// do not save sql expressions
131
foreach
(
$data
as
$k
=> $v)
132
{
133
if
($v instanceof
SqlExpression
)
134
{
135
unset(
$data
[
$k
]);
136
}
137
}
138
139
$this->data =
$data
;
140
141
return
$this;
142
}
143
148
public
function
getData
()
149
{
150
return
$this->data
;
151
}
152
}
Bitrix\Main\DB\SqlExpression
Определения
sqlexpression.php:21
Bitrix\Main\ErrorCollection
Определения
errorcollection.php:14
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
Bitrix\Main\ORM\Data\Result\getErrors
getErrors()
Определения
result.php:62
Bitrix\Main\Result\addError
addError(Error $error)
Определения
result.php:50
Bitrix\Main\Result\__construct
__construct()
Определения
result.php:24
Bitrix\Main\Result\getError
getError()
Определения
result.php:62
Bitrix\Main\Result\addErrors
addErrors(array $errors)
Определения
result.php:113
Bitrix\Main\Result\$isSuccess
$isSuccess
Определения
result.php:17
Bitrix\Main\Result\$errors
ErrorCollection $errors
Определения
result.php:19
Bitrix\Main\Result\isSuccess
isSuccess()
Определения
result.php:39
Bitrix\Main\Result\getErrors
getErrors()
Определения
result.php:77
Bitrix\Main\Result\$data
$data
Определения
result.php:22
Bitrix\Main\Result\getData
getData()
Определения
result.php:148
Bitrix\Main\Result\setData
setData(array $data)
Определения
result.php:128
Bitrix\Main\Result\getErrorCollection
getErrorCollection()
Определения
result.php:87
Bitrix\Main\Result\__clone
__clone()
Определения
result.php:29
Bitrix\Main\Result\getErrorMessages
getErrorMessages()
Определения
result.php:97
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$messages
$messages
Определения
template.php:8
$error
$error
Определения
subscription_card_product.php:20
$k
$k
Определения
template_pdf.php:567
bitrix
modules
main
lib
result.php
Создано системой
1.14.0