Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
base.php
1<?php
2
3
5
6
9
10class Base
11{
12 static protected function onReceive($orderId, array $settings)
13 {
14 $item = \Bitrix\Sale\Exchange\Integration\Relation\Relation::getByEntity(
15 Integration\EntityType::ORDER,
16 $orderId,
17 Integration\CRM\EntityType::DEAL,
18 ''
19 );
20
21 $relation = Integration\Relation\Relation::createFromArray([
22 'SRC_ENTITY_TYPE_ID'=>$item['SRC_ENTITY_TYPE_ID'],
23 'SRC_ENTITY_ID'=>$item['SRC_ENTITY_ID'],
24 'DST_ENTITY_TYPE_ID'=>$item['DST_ENTITY_TYPE_ID'],
25 'DST_ENTITY_ID'=>$item['DST_ENTITY_ID']
26 ]);
27
29
30 $r = $proxy->onReceive(
31 $relation->getDestinationEntityId(),
32 $relation->getDestinationEntityTypeId(),
33 $settings
34 );
35
36 if($r->isSuccess())
37 {
38 $result = $r->getData()['DATA']['result'];
39 }
40 else
41 {
42 $result['error'] = $r->getErrorMessages();
43 }
44
45 //ECHO '<pre>'; PRINT_R($order->getFields()->getOriginalValues());DIE;
46 //ECHO '<pre>'; PRINT_R($result);DIE;
47 }
48
49 static protected function isSync(\Bitrix\Sale\Order $order)
50 {
51 return (new Integration\Connector\Manager())->isOn() && $order->getField('IS_SYNC_B24') == 'Y';
52 }
53}
static isSync(\Bitrix\Sale\Order $order)
Definition base.php:49
static onReceive($orderId, array $settings)
Definition base.php:12