StateResolver
Magento\Sales\Model\Order\StateResolver
What it does
The StateResolver class determines the appropriate state for an order based on its current conditions and properties.
Developers use this class when they need to programmatically calculate what state an order should be in (new, processing, complete, or closed) based on factors like whether it can be invoiced, shipped, credited, or if it's been refunded.
This is commonly used during order status transitions to ensure the order state accurately reflects its fulfillment status.
Public Methods
- getStateForOrder()