Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
orderack.php
1<?php
2
4
5use \Bitrix\Main\ArgumentTypeException;
7
9{
10 public function convert($data)
11 {
12 if(!is_array($data))
13 throw new ArgumentTypeException("data", "array");
14
15 $result = "";
16
17 foreach($data as $item)
18 {
19 if(empty($item["ORDER_ID"]) || empty($item["ORDER_LINE_ITEM_ID"]))
20 throw new SystemException("Wrong structure of ack data item");
21
22 $result .=
23 "\t<OrderAck>\n".
24 "\t\t<OrderID>".$item["ORDER_ID"]."</OrderID>\n".
25 "\t\t<OrderLineItemID>".$item["ORDER_LINE_ITEM_ID"]."</OrderLineItemID>\n".
26 "\t</OrderAck>\n";
27 }
28
29 return $result;
30 }
31}