Bitrix-D7  20.0.0
eventactions.php
См. документацию.
1 <?php
2 namespace Bitrix\Sale;
3 
5 
7 {
8  const ADD = "ADD";
9  const UPDATE = "UPDATE";
10  const DELETE = "DELETE";
11 
12  // Events new kernel
13  const EVENT_ON_ORDER_PAID = "OnSaleOrderPaid";
14  const EVENT_ON_BEFORE_ORDER_DELETE = "OnSaleBeforeOrderDelete";
15  const EVENT_ON_ORDER_DELETED = "OnSaleOrderDeleted";
16  const EVENT_ON_ORDER_BEFORE_SAVED = "OnSaleOrderBeforeSaved";
17  const EVENT_ON_ORDER_SAVED = "OnSaleOrderSaved";
18  const EVENT_ON_SHIPMENT_DELIVER = "OnSaleShipmentDelivery";
19 
20  const EVENT_ON_BEFORE_ORDER_CANCELED = "OnSaleBeforeOrderCanceled";
21  const EVENT_ON_ORDER_CANCELED = "OnSaleOrderCanceled";
22 
23  const EVENT_ON_ORDER_PAID_SEND_MAIL = "OnSaleOrderPaidSendMail";
24  const EVENT_ON_ORDER_CANCELED_SEND_MAIL = "OnSaleOrderCancelSendEmail";
25 
26  const EVENT_ON_BASKET_BEFORE_SAVED = "OnSaleBasketBeforeSaved";
27  const EVENT_ON_BASKET_ITEM_BEFORE_SAVED = "OnSaleBasketItemBeforeSaved";
28  const EVENT_ON_BASKET_ITEM_SAVED = "OnSaleBasketItemSaved";
29  const EVENT_ON_BASKET_SAVED = "OnSaleBasketSaved";
30 
31  const EVENT_ON_SHIPMENT_TRACKING_NUMBER_CHANGE = "OnShipmentTrackingNumberChange";
32  const EVENT_ON_SHIPMENT_ALLOW_DELIVERY = "OnShipmentAllowDelivery";
33  const EVENT_ON_SHIPMENT_DEDUCTED = "OnShipmentDeducted";
34 
35  const EVENT_ON_BEFORE_SHIPMENT_RESERVE = "OnSaleBeforeShipmentReserve";
36  const EVENT_ON_SHIPMENT_RESERVED = "OnSaleShipmentReserved";
37 
38  const EVENT_ON_PAYMENT_PAID = "OnPaymentPaid";
39 
40  const EVENT_ON_BEFORE_ORDER_STATUS_CHANGE = "OnSaleBeforeStatusOrderChange";
41  const EVENT_ON_ORDER_STATUS_CHANGE = "OnSaleStatusOrderChange";
42  const EVENT_ON_ORDER_STATUS_CHANGE_SEND_MAIL = "OnSaleOrderStatusChangeSendEmail";
43 
44  const EVENT_ON_BEFORE_SHIPMENT_STATUS_CHANGE = "OnSaleBeforeStatusShipmentChange";
45  const EVENT_ON_SHIPMENT_STATUS_CHANGE = "OnSaleStatusShipmentChange";
46  const EVENT_ON_SHIPMENT_STATUS_CHANGE_SEND_MAIL = "OnSaleShipmentStatusChangeSendEmail";
47 
48  const EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE = "OnSaleStatusAllowPayChange";
49  const EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE_SEND_MAIL = "onSaleOrderStatusAllowPaySendEmail";
50 
51  const EVENT_ON_ADMIN_ORDER_LIST = "OnSaleAdminOrderList";
52 
53  const EVENT_ON_BASKET_ITEM_REFRESH_DATA = "OnSaleBasketItemRefreshData";
54 
55  const EVENT_ON_CHECK_PRINT = "OnSalePaymentCheckPrint";
56 
57  const EVENT_ON_CHECK_PRINT_ERROR = "OnSalePaymentCheckPrintError";
58 
59  const EVENT_ON_TAX_GET_LIST = "OnSaleTaxGetList";
60 
61  const ENTITY_COLLECTABLE_ENTITY = CollectableEntity::class;
62 
63  const EVENT_ON_ORDER_BEFORE_ARCHIVED = "OnSaleOrderBeforeArchived";
64 
65  /**
66  * @return array
67  * @throws \Bitrix\Main\ArgumentException
68  */
69  public static function getEventNotifyMap()
70  {
72 
73  /** @var Order $orderEntity */
74  $orderEntity = $registry->getOrderClassName();
75 
76  /** @var Shipment $shipmentEntity */
77  $shipmentEntity = $registry->getShipmentClassName();
78 
79  /** @var Notify $notifyEntity */
80  $notifyEntity = $registry->getNotifyClassName();
81 
82  return array(
83  static::EVENT_ON_ORDER_SAVED => array(
84  "ENTITY" => $orderEntity,
85  "METHOD" => array($notifyEntity, "sendOrderNew"),
86  ),
87  static::EVENT_ON_ORDER_CANCELED => array(
88  "ENTITY" => $orderEntity,
89  "METHOD" => array($notifyEntity, "sendOrderCancel"),
90  ),
91  static::EVENT_ON_ORDER_PAID => array(
92  "ENTITY" => $orderEntity,
93  "METHOD" => array($notifyEntity, "sendOrderPaid"),
94  ),
95 
96  static::EVENT_ON_ORDER_STATUS_CHANGE => array(
97  "ENTITY" => $orderEntity,
98  "METHOD" => array($notifyEntity, "sendOrderStatusChange"),
99  ),
100  static::EVENT_ON_SHIPMENT_TRACKING_NUMBER_CHANGE => array(
101  "ENTITY" => $shipmentEntity,
102  "METHOD" => array($notifyEntity, "sendShipmentTrackingNumberChange"),
103  ),
104  static::EVENT_ON_SHIPMENT_ALLOW_DELIVERY => array(
105  "ENTITY" => $shipmentEntity,
106  "METHOD" => array($notifyEntity, "sendShipmentAllowDelivery"),
107  ),
108  static::EVENT_ON_SHIPMENT_STATUS_CHANGE => array(
109  "ENTITY" => $shipmentEntity,
110  "METHOD" => array($notifyEntity, "sendShipmentStatusChange"),
111  ),
112 
113  static::EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE => array(
114  "ENTITY" => $orderEntity,
115  "METHOD" => array($notifyEntity, "sendOrderAllowPayStatusChange"),
116  ),
117 
118  static::EVENT_ON_CHECK_PRINT => array(
119  "ENTITY" => static::ENTITY_COLLECTABLE_ENTITY,
120  "METHOD" => array($notifyEntity, "sendPrintableCheck"),
121  ),
122 
123  static::EVENT_ON_CHECK_PRINT_ERROR => array(
124  "ENTITY" => static::ENTITY_COLLECTABLE_ENTITY,
125  "METHOD" => array($notifyEntity, "sendCheckError"),
126  ),
127 
128  );
129  }
130 
131 }
Bitrix\Sale\EventActions\EVENT_ON_ORDER_BEFORE_ARCHIVED
const EVENT_ON_ORDER_BEFORE_ARCHIVED
Definition: eventactions.php:63
Bitrix\Sale\EventActions\getEventNotifyMap
static getEventNotifyMap()
Definition: eventactions.php:69
Bitrix\Sale\Internals\CollectableEntity
Definition: collectableentity.php:12
Bitrix\Sale\EventActions\EVENT_ON_PAYMENT_PAID
const EVENT_ON_PAYMENT_PAID
Definition: eventactions.php:38
Bitrix\Sale\EventActions\EVENT_ON_ORDER_CANCELED
const EVENT_ON_ORDER_CANCELED
Definition: eventactions.php:21
Bitrix\Sale\EventActions\EVENT_ON_BASKET_BEFORE_SAVED
const EVENT_ON_BASKET_BEFORE_SAVED
Definition: eventactions.php:26
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_STATUS_CHANGE_SEND_MAIL
const EVENT_ON_SHIPMENT_STATUS_CHANGE_SEND_MAIL
Definition: eventactions.php:46
Bitrix\Sale\EventActions\ADD
const ADD
Definition: eventactions.php:8
Bitrix\Sale\EventActions\EVENT_ON_BEFORE_ORDER_STATUS_CHANGE
const EVENT_ON_BEFORE_ORDER_STATUS_CHANGE
Definition: eventactions.php:40
Bitrix\Sale\EventActions\EVENT_ON_ORDER_SAVED
const EVENT_ON_ORDER_SAVED
Definition: eventactions.php:17
Bitrix\Sale\EventActions\EVENT_ON_CHECK_PRINT_ERROR
const EVENT_ON_CHECK_PRINT_ERROR
Definition: eventactions.php:57
Bitrix\Sale\Registry\REGISTRY_TYPE_ORDER
const REGISTRY_TYPE_ORDER
Definition: sale/lib/registry.php:16
Bitrix\Sale\EventActions\DELETE
const DELETE
Definition: eventactions.php:10
Bitrix\Sale\EventActions\EVENT_ON_BASKET_ITEM_SAVED
const EVENT_ON_BASKET_ITEM_SAVED
Definition: eventactions.php:28
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_DEDUCTED
const EVENT_ON_SHIPMENT_DEDUCTED
Definition: eventactions.php:33
Bitrix\Sale\EventActions\EVENT_ON_ORDER_STATUS_CHANGE_SEND_MAIL
const EVENT_ON_ORDER_STATUS_CHANGE_SEND_MAIL
Definition: eventactions.php:42
Bitrix\Sale\EventActions\EVENT_ON_BASKET_ITEM_REFRESH_DATA
const EVENT_ON_BASKET_ITEM_REFRESH_DATA
Definition: eventactions.php:53
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_STATUS_CHANGE
const EVENT_ON_SHIPMENT_STATUS_CHANGE
Definition: eventactions.php:45
Bitrix\Sale\EventActions\EVENT_ON_ORDER_BEFORE_SAVED
const EVENT_ON_ORDER_BEFORE_SAVED
Definition: eventactions.php:16
Bitrix\Sale\Registry\getInstance
static getInstance($type)
Definition: sale/lib/registry.php:161
Bitrix\Sale\EventActions\UPDATE
const UPDATE
Definition: eventactions.php:9
Bitrix\Sale\EventActions\EVENT_ON_TAX_GET_LIST
const EVENT_ON_TAX_GET_LIST
Definition: eventactions.php:59
Bitrix\Sale\EventActions\EVENT_ON_BEFORE_ORDER_CANCELED
const EVENT_ON_BEFORE_ORDER_CANCELED
Definition: eventactions.php:20
Bitrix\Sale\EventActions\EVENT_ON_BASKET_ITEM_BEFORE_SAVED
const EVENT_ON_BASKET_ITEM_BEFORE_SAVED
Definition: eventactions.php:27
Bitrix\Sale\EventActions\EVENT_ON_ORDER_STATUS_CHANGE
const EVENT_ON_ORDER_STATUS_CHANGE
Definition: eventactions.php:41
Bitrix\Sale\EventActions\EVENT_ON_ORDER_PAID_SEND_MAIL
const EVENT_ON_ORDER_PAID_SEND_MAIL
Definition: eventactions.php:23
Bitrix\Sale\EventActions\EVENT_ON_ORDER_CANCELED_SEND_MAIL
const EVENT_ON_ORDER_CANCELED_SEND_MAIL
Definition: eventactions.php:24
Bitrix\Sale\EventActions\ENTITY_COLLECTABLE_ENTITY
const ENTITY_COLLECTABLE_ENTITY
Definition: eventactions.php:61
Bitrix\Sale
Created by PhpStorm.
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_RESERVED
const EVENT_ON_SHIPMENT_RESERVED
Definition: eventactions.php:36
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_DELIVER
const EVENT_ON_SHIPMENT_DELIVER
Definition: eventactions.php:18
Bitrix\Sale\EventActions\EVENT_ON_BEFORE_SHIPMENT_STATUS_CHANGE
const EVENT_ON_BEFORE_SHIPMENT_STATUS_CHANGE
Definition: eventactions.php:44
Bitrix\Sale\EventActions
Definition: eventactions.php:6
Bitrix\Sale\EventActions\EVENT_ON_BEFORE_SHIPMENT_RESERVE
const EVENT_ON_BEFORE_SHIPMENT_RESERVE
Definition: eventactions.php:35
Bitrix\Sale\EventActions\EVENT_ON_BEFORE_ORDER_DELETE
const EVENT_ON_BEFORE_ORDER_DELETE
Definition: eventactions.php:14
Bitrix\Sale\EventActions\EVENT_ON_ORDER_PAID
const EVENT_ON_ORDER_PAID
Definition: eventactions.php:13
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_ALLOW_DELIVERY
const EVENT_ON_SHIPMENT_ALLOW_DELIVERY
Definition: eventactions.php:32
Bitrix\Sale\EventActions\EVENT_ON_ORDER_DELETED
const EVENT_ON_ORDER_DELETED
Definition: eventactions.php:15
Bitrix\Sale\EventActions\EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE
const EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE
Definition: eventactions.php:48
Bitrix\Sale\EventActions\EVENT_ON_CHECK_PRINT
const EVENT_ON_CHECK_PRINT
Definition: eventactions.php:55
Bitrix\Sale\EventActions\EVENT_ON_SHIPMENT_TRACKING_NUMBER_CHANGE
const EVENT_ON_SHIPMENT_TRACKING_NUMBER_CHANGE
Definition: eventactions.php:31
Bitrix\Sale\EventActions\EVENT_ON_BASKET_SAVED
const EVENT_ON_BASKET_SAVED
Definition: eventactions.php:29
Bitrix\Sale\EventActions\EVENT_ON_ADMIN_ORDER_LIST
const EVENT_ON_ADMIN_ORDER_LIST
Definition: eventactions.php:51
Bitrix\Sale\EventActions\EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE_SEND_MAIL
const EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE_SEND_MAIL
Definition: eventactions.php:49