Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
processresult.php
1<?php
2
4
6
8{
9 public function convert($data)
10 {
11 if(!isset($data["RESULT_ID"]))
12 throw new ArgumentNullException("data[\"RESULT_ID\"]");
13
14 if(!isset($data["CONTENT"]))
15 throw new ArgumentNullException("data[\"CONTENT\"]");
16
17 $result["RESULT_ID"] = $data["RESULT_ID"];
18
19 if((string)$data["CONTENT"] !== '')
20 {
21 $strings = explode("\n", $data["CONTENT"]);
22 $fields = array();
23
24 if(is_array($strings))
25 {
26 foreach($strings as $string)
27 {
28 $info = json_decode($string, true);
29
30 if(mb_strpos($info["message"], "Processing Request #") !== false)
31 $fields["PROCESSING_REQUEST_ID"] = mb_substr($info["message"], 20);
32 elseif(mb_strpos($info["message"], "Processing Complete") !== false)
33 $fields["PROCESSING_RESULT"] = "Complete";
34 }
35
36 if(!empty($fields))
37 $result = array_merge($result, $fields);
38 }
39 }
40
41 return $result;
42 }
43}