$historyData['order_status_id'
] =
$eventArgs->
getNewValue('orderStatus'
)->
getId();
} else { $historyData['previous_order_status_id'
] =
$order->
getOrderStatus()->
getId();
$historyData['order_status_id'
] =
$order->
getOrderStatus()->
getId();
} // Payment status changed?
if ($eventArgs->
hasChangedField('paymentStatus'
)) { $historyData['previous_payment_status_id'
] =
$eventArgs->
getOldValue('paymentStatus'
)->
getId();
$historyData['payment_status_id'
] =
$eventArgs->
getNewValue('paymentStatus'
)->
getId();
} else { $historyData['previous_payment_status_id'
] =
$order->
getPaymentStatus()->
getId();
$historyData['payment_status_id'
] =
$order->
getPaymentStatus()->
getId();
} $eventArgs->
getEntityManager()->
getConnection()->
insert('s_order_history',
$historyData);
} /**
* @return bool
*/
private function hasIdentity() {