Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
triggerordernew.php
1
<?
2
3
namespace
Bitrix\Sale\Sender
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\Loader
;
7
use
Bitrix\Sale
;
8
9
if
(!Loader::includeModule(
'sender'
))
10
{
11
return
;
12
}
13
14
Loc::loadMessages
(__FILE__);
15
16
class
TriggerOrderNew
extends
\Bitrix\Sender\TriggerConnector
17
{
18
19
public
function
getName
()
20
{
21
return
Loc::getMessage
(
'sender_trigger_order_new_name'
);
22
}
23
24
public
function
getCode
()
25
{
26
return
"order_new"
;
27
}
28
29
public
function
getEventModuleId
()
30
{
31
return
'sale'
;
32
}
33
34
public
function
getEventType
()
35
{
36
return
"OnOrderAdd"
;
37
}
38
39
public
function
getConnector
()
40
{
41
$connector
= new \Bitrix\Sale\Sender\ConnectorOrder;
42
$connector
->setModuleId(
'sale'
);
43
44
return
$connector
;
45
}
46
48
public
function
getProxyFieldsFromEventToConnector
()
49
{
50
$eventData = $this->getParam(
'EVENT'
);
51
return
array(
'ID'
=> $eventData[0],
'LID'
=> $this->getSiteId());
52
}
53
58
public
function
getPersonalizeFields()
59
{
60
$eventData = $this->getParam(
'EVENT'
);
61
$result = [
'ORDER_ID'
=> $eventData[0]];
62
if
((
int
)$eventData[0] <= 0)
63
return
$result;
64
65
$registry = Sale\Registry::getInstance(
Sale
\
Registry::REGISTRY_TYPE_ORDER
);
67
$orderClass = $registry->getOrderClassName();
68
69
$order = $orderClass::load($eventData[0]);
70
if
($order)
71
{
72
$result = [
73
'ORDER_ID'
=> $order->getField(
'ACCOUNT_NUMBER'
),
74
'ORDER_REAL_ID'
=> $order->getId()
75
];
76
}
77
return
$result;
78
}
79
83
public
static
function
getPersonalizeList
()
84
{
85
return
array(
86
array(
87
'CODE'
=>
'ORDER_ID'
,
88
'NAME'
=>
Loc::getMessage
(
'sender_trigger_order_new_pers_order_id_name'
),
89
'DESC'
=>
Loc::getMessage
(
'sender_trigger_order_new_pers_order_id_desc'
)
90
)
91
);
92
}
93
94
public
function
getForm
()
95
{
96
return
''
;
97
}
98
99
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Registry\REGISTRY_TYPE_ORDER
const REGISTRY_TYPE_ORDER
Definition
registry.php:16
Bitrix\Sale\Sender\TriggerOrderNew
Definition
triggerordernew.php:17
Bitrix\Sale\Sender\TriggerOrderNew\getEventModuleId
getEventModuleId()
Definition
triggerordernew.php:29
Bitrix\Sale\Sender\TriggerOrderNew\getName
getName()
Definition
triggerordernew.php:19
Bitrix\Sale\Sender\TriggerOrderNew\getForm
getForm()
Definition
triggerordernew.php:94
Bitrix\Sale\Sender\TriggerOrderNew\getEventType
getEventType()
Definition
triggerordernew.php:34
Bitrix\Sale\Sender\TriggerOrderNew\getConnector
getConnector()
Definition
triggerordernew.php:39
Bitrix\Sale\Sender\TriggerOrderNew\getProxyFieldsFromEventToConnector
getProxyFieldsFromEventToConnector()
Definition
triggerordernew.php:48
Bitrix\Sale\Sender\TriggerOrderNew\getCode
getCode()
Definition
triggerordernew.php:24
Bitrix\Sale\Sender\TriggerOrderNew\getPersonalizeList
static getPersonalizeList()
Definition
triggerordernew.php:83
Bitrix\Sender\Trigger\TriggerConnector
Definition
triggerconnector.php:13
Bitrix\Sender\Trigger\TriggerConnector\$connector
$connector
Definition
triggerconnector.php:15
Bitrix\Sale\Sender
Definition
connectororder.php:3
Bitrix\Sale
Sale
modules
sale
lib
sender
triggerordernew.php
Создано системой
1.10.0