Log in
Model

InsertOrderStatusChangeHistory

Magento\Sales\Model\InsertOrderStatusChangeHistory

What it does

This class is responsible for tracking order status changes in Magento 2 by recording them in the status change history table.

Developers would use this class when they need to automatically log status transitions for orders, ensuring that each status change is properly recorded for auditing and tracking purposes.

It checks if the order's current status differs from the last recorded status before inserting a new history entry.

Public Methods

  • execute()