21 if (!$order instanceof
Order)
26 return $order->getPaySystemIdList();
37 if (!$order instanceof
Order)
42 return $order->getDeliveryIdList();
47 if (!$order instanceof
Order)
52 return $order->getTradeBindingCollection()->getTradingPlatformIdList();
57 if (!$order instanceof
Order)
62 return $order->getTradeBindingCollection()->getTradingPlatformIdList();
72 protected function update()
78 if (!$order = $propertyCollection->getOrder())
84 if ($order->getId() > 0)
86 $logFields = $this->getLogFieldsForUpdate();
89 $result = parent::update();
90 if ($result->isSuccess())
92 if ($order->getId() > 0)
94 $this->addToLog(
'PROPERTY_UPDATE', $logFields);
104 private function getLogFieldsForUpdate()
107 "NAME" => $this->getField(
"NAME"),
108 "VALUE" => $this->getField(
"VALUE"),
109 "CODE" => $this->getField(
"CODE"),
113 $originalValues = $fields->getOriginalValues();
114 if (array_key_exists(
"NAME", $originalValues))
115 $logFields[
'OLD_NAME'] = $originalValues[
"NAME"];
117 if (array_key_exists(
"VALUE", $originalValues))
118 $logFields[
'OLD_VALUE'] = $originalValues[
"VALUE"];
120 if (array_key_exists(
"CODE", $originalValues))
121 $logFields[
'OLD_CODE'] = $originalValues[
"CODE"];
129 private function getLogFieldsForAdd()
132 "NAME" => $this->getField(
"NAME"),
133 "VALUE" => $this->getField(
"VALUE"),
134 "CODE" => $this->getField(
"CODE"),
146 private function addToLog($type, $fields)
152 if (!$order = $propertyCollection->getOrder())
154 throw new Main\ObjectNotFoundException(
'Entity "Order" not found');
160 $orderHistory = $registry->getOrderHistoryClassName();
161 $orderHistory::addLog(
168 $orderHistory::SALE_ORDER_HISTORY_LOG_LEVEL_1
180 protected function add()
186 if (!$order = $propertyCollection->getOrder())
188 throw new Main\ObjectNotFoundException(
'Entity "Order" not found');
192 if ($order->getId() > 0)
194 $logFields = $this->getLogFieldsForAdd();
197 $result = parent::add();
198 if ($result->isSuccess())
200 if ($order->getId() > 0)
202 $this->addToLog(
'PROPERTY_ADD', $logFields);