Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
processresult.php
1
<?php
2
3
namespace
Bitrix\Sale\TradingPlatform\Ebay\Feed\Data\Converters
;
4
5
use
Bitrix\Main\ArgumentNullException
;
6
7
class
ProcessResult
extends
DataConverter
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
}
Bitrix\Main\ArgumentNullException
Definition
exception.php:54
Bitrix\Sale\TradingPlatform\Ebay\Feed\Data\Converters\DataConverter
Definition
dataconverter.php:6
Bitrix\Sale\TradingPlatform\Ebay\Feed\Data\Converters\ProcessResult
Definition
processresult.php:8
Bitrix\Sale\TradingPlatform\Ebay\Feed\Data\Converters\ProcessResult\convert
convert($data)
Definition
processresult.php:9
Bitrix\Sale\TradingPlatform\Ebay\Feed\Data\Converters
Definition
dataconverter.php:3
modules
sale
lib
tradingplatform
ebay
feed
data
converters
processresult.php
Создано системой
1.10.0