Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
result.php
1
<?
2
namespace
Bitrix\Sale\Delivery\Requests
;
3
4
use
Bitrix\Main\Error
;
5
use
Bitrix\Main\ErrorCollection
;
6
11
class
Result
extends
\Bitrix\Main\Result
12
{
13
protected
$messages
= array();
15
protected
$results
= array();
16
20
public
function
__construct
()
21
{
22
$this->messages =
new
MessagesCollection
();
23
parent::__construct();
24
}
25
29
public
function
addMessage
(
Message
$message)
30
{
31
$this->messages[] = $message;
32
}
33
37
public
function
getMessages
()
38
{
39
return
$this->messages->toArray();
40
}
41
45
public
function
getMessagesCollection
()
46
{
47
return
$this->messages;
48
}
49
53
public
function
getMessagesMessages
()
54
{
55
$messages
= array();
56
57
foreach
($this->
getMessages
() as $message)
58
$messages
[] = $message->getMessage();
59
60
return
$messages
;
61
}
62
69
public
function
addMessages
(array $messages)
70
{
71
$this->
isSuccess
=
false
;
72
$this->errors->add($messages);
73
return
$this;
74
}
75
76
80
public
function
getResults
()
81
{
82
return
$this->results;
83
}
84
88
public
function
getShipmentResults
()
89
{
90
$result = array();
91
92
foreach
($this->results as $res)
93
if
($res instanceof
ShipmentResult
)
94
$result[] = $res;
95
96
return
$result;
97
}
98
102
public
function
getRequestResults
()
103
{
104
$result = array();
105
106
foreach
($this->results as $res)
107
if
($res instanceof
RequestResult
)
108
$result[] = $res;
109
110
return
$result;
111
}
112
116
public
function
setResults
($results)
117
{
118
$this->results =
$results
;
119
}
120
124
public
function
addResult
(
Result
$result)
125
{
126
$this->results[] = $result;
127
}
128
132
public
function
addResults
(array $results)
133
{
134
foreach
($results as $result)
135
$this->results[] = $result;
136
}
137
}
138
139
class
MessagesCollection
extends
ErrorCollection
{};
140
class
Message
extends
Error
{};
Bitrix\Main\ErrorCollection
Definition
errorcollection.php:14
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\ORM\Data\Result\isSuccess
isSuccess($internalCall=false)
Definition
result.php:52
Bitrix\Sale\Delivery\Requests\Message
Definition
result.php:140
Bitrix\Sale\Delivery\Requests\MessagesCollection
Definition
result.php:139
Bitrix\Sale\Delivery\Requests\RequestResult
Definition
requestresult.php:9
Bitrix\Sale\Delivery\Requests\Result\__construct
__construct()
Definition
result.php:20
Bitrix\Sale\Delivery\Requests\Result\$messages
$messages
Definition
result.php:13
Bitrix\Sale\Delivery\Requests\Result\$results
$results
Definition
result.php:15
Bitrix\Sale\Delivery\Requests\Result\getResults
getResults()
Definition
result.php:80
Bitrix\Sale\Delivery\Requests\Result\addResult
addResult(Result $result)
Definition
result.php:124
Bitrix\Sale\Delivery\Requests\Result\getMessagesMessages
getMessagesMessages()
Definition
result.php:53
Bitrix\Sale\Delivery\Requests\Result\getMessages
getMessages()
Definition
result.php:37
Bitrix\Sale\Delivery\Requests\Result\addMessage
addMessage(Message $message)
Definition
result.php:29
Bitrix\Sale\Delivery\Requests\Result\addMessages
addMessages(array $messages)
Definition
result.php:69
Bitrix\Sale\Delivery\Requests\Result\setResults
setResults($results)
Definition
result.php:116
Bitrix\Sale\Delivery\Requests\Result\addResults
addResults(array $results)
Definition
result.php:132
Bitrix\Sale\Delivery\Requests\Result\getRequestResults
getRequestResults()
Definition
result.php:102
Bitrix\Sale\Delivery\Requests\Result\getShipmentResults
getShipmentResults()
Definition
result.php:88
Bitrix\Sale\Delivery\Requests\Result\getMessagesCollection
getMessagesCollection()
Definition
result.php:45
Bitrix\Sale\Delivery\Requests\ShipmentResult
Definition
shipmentresult.php:9
Bitrix\Sale\Delivery\Requests
Definition
handlerbase.php:2
modules
sale
lib
delivery
requests
result.php
Создано системой
1.10.0