Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
result.php
1<?
3
6
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
140class Message extends Error{};
isSuccess($internalCall=false)
Definition result.php:52