Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
handlerbase.php
1<?
3
8
9Loc::loadMessages(__FILE__);
10
16abstract class HandlerBase
17{
18 public const CANCEL_ACTION_CODE = 'CANCEL';
19
22
27 public function __construct(Delivery\Services\Base $deliveryService)
28 {
29 $this->deliveryService = $deliveryService;
30 }
31
38 public function create(array $shipmentIds, array $additional = [])
39 {
40 $result = new Result();
41 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_CREATE_NOT_SUPPORT')));
42 return $result;
43 }
44
50 public function getActions($requestId)
51 {
52 return [];
53 }
54
58 public function getCancelActionCode(): string
59 {
61 }
62
66 public function getCancelActionName(): string
67 {
68 return Loc::getMessage('SALE_DLVR_REQ_BASE_CANCEL_REQUEST');
69 }
70
76 public function getShipmentActions(Shipment $shipment)
77 {
78 return [];
79 }
80
88 public function executeAction($requestId, $actionType, array $additional)
89 {
90 $result = new Result();
91 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_ACTIONS_NOT_SUPPORT')));
92 return $result;
93 }
94
103 public function executeShipmentAction($requestId, $shipmentId, $actionType, array $additional)
104 {
105 $result = new Result();
106 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_SHIPMENT_ACTIONS_NOT_SUPPORT')));
107 return $result;
108 }
109
117 public function addShipments($requestId, $shipmentIds, array $additional = [])
118 {
119 $result = new Result();
120 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_SHIPMENT_ADD_NOT_SUPPORT')));
121 return $result;
122 }
123
129 public function delete($requestId)
130 {
131 $result = new Result();
132 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_DELETE_NOT_SUPPORT')));
133 return $result;
134 }
135
142 public function deleteShipments($requestId, array $shipmentIds = [])
143 {
144 $result = new Result();
145 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_SHIPMENT_DELETE_NOT_SUPPORT')));
146 return $result;
147 }
148
155 public function updateShipments($requestId, array $shipmentIds = [])
156 {
157 $result = new Result();
158 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_SHIPMENT_UPDATE_NOT_SUPPORTED')));
159 return $result;
160 }
161
170 public function getFormFields($formFieldsType, array $shipmentIds, array $additional = [])
171 {
172 return [];
173 }
174
180 public function getContent($requestId)
181 {
182 $result = new Result();
183 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_VIEW_NOT_SUPPORT')));
184 return $result;
185 }
186
193 public function getShipmentContent($requestId, $shipmentId)
194 {
195 $result = new Result();
196 $result->addError(new Main\Error(Loc::getMessage('SALE_DLVR_REQ_BASE_SHIPMENT_VIEW_NOT_SUPPORT')));
197 return $result;
198 }
199
205 {
206 return $this->deliveryService->getId();
207 }
208
212 public function hasCallbackTrackingSupport(): bool
213 {
214 return false;
215 }
216}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
getFormFields($formFieldsType, array $shipmentIds, array $additional=[])
executeAction($requestId, $actionType, array $additional)
executeShipmentAction($requestId, $shipmentId, $actionType, array $additional)
getShipmentContent($requestId, $shipmentId)
addShipments($requestId, $shipmentIds, array $additional=[])
deleteShipments($requestId, array $shipmentIds=[])
__construct(Delivery\Services\Base $deliveryService)
updateShipments($requestId, array $shipmentIds=[])
create(array $shipmentIds, array $additional=[])