1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
result.php
См. документацию.
1
<?php
2
namespace
Bitrix\Sale;
3
4
use Bitrix\Main\Entity;
5
use Bitrix\Main\Error;
6
use Bitrix\Main\ErrorCollection;
7
8
class
Result
extends
\Bitrix\Main\ORM\Data\Result
9
{
11
protected
$id
;
12
13
protected
$warnings
=
array
();
14
16
protected
$isSuccess
=
true
;
17
18
public
function
__construct
()
19
{
20
$this->warnings =
new
ErrorCollection
();
21
parent::__construct();
22
}
23
24
public
function
setId
(
$id
)
25
{
26
$this->
id
=
$id
;
27
}
28
33
public
function
getId
()
34
{
35
return
$this->id;
36
}
37
38
public
function
__destruct
()
39
{
40
//just quietly die in contrast Entity\Result either checked errors or not.
41
}
42
43
public
function
addData
(
array
$data
)
44
{
45
if
(is_array($this->data))
46
{
47
$this->data = $this->data +
$data
;
48
}
49
else
50
{
51
$this->data =
$data
;
52
}
53
}
54
55
public
function
get
($offset)
56
{
57
if
(isset($this->data[$offset]) || array_key_exists($offset, $this->data))
58
{
59
return
$this->data[$offset];
60
}
61
62
return
null
;
63
}
64
65
public
function
set
($offset, $value)
66
{
67
if
($offset ===
null
)
68
{
69
$this->data[] = $value;
70
}
71
else
72
{
73
$this->data[$offset] = $value;
74
}
75
}
76
82
public
function
addWarnings(
array
$errors
)
83
{
85
foreach
(
$errors
as
$error
)
86
{
87
$this->addWarning(
ResultWarning::create
(
$error
));
88
}
89
}
90
96
public
function
addWarning
(
Error
$error
)
97
{
98
$this->warnings[] =
$error
;
99
}
100
107
public
function
addError
(
Error
$error
)
108
{
109
if
(
$error
instanceof
ResultWarning
)
110
{
111
static::addWarning(
$error
);
112
}
113
else
114
{
115
$this->
isSuccess
=
false
;
116
$this->errors[] =
$error
;
117
}
118
119
return
$this;
120
}
121
127
public
function
getWarnings
()
128
{
129
return
$this->warnings->toArray();
130
}
131
137
public
function
getWarningMessages
()
138
{
139
$messages
=
array
();
140
141
foreach
($this->
getWarnings
() as $warning)
142
$messages
[] = $warning->getMessage();
143
144
return
$messages
;
145
}
146
147
151
public
function
hasWarnings
()
152
{
153
return
(
count
($this->warnings));
154
}
155
156
157
}
158
159
class
ResultError
160
extends
Entity\EntityError
161
{
167
public
static
function
create
(
Error
$error
)
168
{
169
return
new
static
(
$error
->getMessage(),
$error
->getCode());
170
}
171
}
172
173
class
ResultWarning
174
extends
ResultError
175
{
176
177
}
178
179
class
ResultNotice
180
extends
ResultError
181
{
182
183
}
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\isSuccess
isSuccess($internalCall=false)
Определения
result.php:47
Bitrix\Main\Result\$data
$data
Определения
result.php:22
Bitrix\Sale\ResultError
Определения
result.php:161
Bitrix\Sale\ResultError\create
static create(Error $error)
Определения
result.php:167
Bitrix\Sale\Result\addError
addError(Error $error)
Определения
result.php:107
Bitrix\Sale\Result\__construct
__construct()
Определения
result.php:18
Bitrix\Sale\Result\getId
getId()
Определения
result.php:33
Bitrix\Sale\Result\$isSuccess
$isSuccess
Определения
result.php:16
Bitrix\Sale\Result\__destruct
__destruct()
Определения
result.php:38
Bitrix\Sale\Result\$warnings
$warnings
Определения
result.php:13
Bitrix\Sale\Result\addData
addData(array $data)
Определения
result.php:43
Bitrix\Sale\Result\addWarning
addWarning(Error $error)
Определения
result.php:96
Bitrix\Sale\Result\setId
setId($id)
Определения
result.php:24
Bitrix\Sale\Result\getWarningMessages
getWarningMessages()
Определения
result.php:137
Bitrix\Sale\Result\getWarnings
getWarnings()
Определения
result.php:127
Bitrix\Sale\Result\hasWarnings
hasWarnings()
Определения
result.php:151
Bitrix\Sale\Result\$id
$id
Определения
result.php:11
Bitrix\Sale\ResultNotice
Определения
result.php:181
Bitrix\Sale\ResultWarning
Определения
result.php:175
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$errors
$errors
Определения
iblock_catalog_edit.php:74
Bitrix\Sale\Discount\Result
Определения
compatibleformat.php:2
count
</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
$messages
$messages
Определения
template.php:8
$error
$error
Определения
subscription_card_product.php:20
bitrix
modules
sale
lib
result.php
Создано системой
1.14.0