Пример #1
0
 private function logShipment($oldValue, $newValue, $orderArray)
 {
     $action = OrderLog::ACTION_STATUSCHANGE;
     if (!$oldValue) {
         $action = OrderLog::ACTION_ADD;
     } else {
         if (!$newValue) {
             $action = OrderLog::ACTION_REMOVE;
         }
     }
     $logEntry = OrderLog::getNewInstance(OrderLog::TYPE_SHIPMENT, $action, $oldValue, $newValue, $this->oldOrder['totalAmount'], $orderArray['totalAmount'], $this->user, $this->currentOrder);
     $logEntry->save();
     return $logEntry;
 }