Bitrix-D7  20.5.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 }
const EVENT_ON_BEFORE_SHIPMENT_STATUS_CHANGE
const EVENT_ON_ORDER_STATUS_CHANGE_SEND_MAIL
const EVENT_ON_SHIPMENT_TRACKING_NUMBER_CHANGE
const EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE_SEND_MAIL
const EVENT_ON_ORDER_STATUS_ALLOW_PAY_CHANGE
const EVENT_ON_SHIPMENT_STATUS_CHANGE_SEND_MAIL
const EVENT_ON_BEFORE_ORDER_STATUS_CHANGE