OrderRepository
Magento\Sales\Model\OrderRepository
What it does
OrderRepository is the primary data access class for managing Magento 2 orders.
Developers use this class to retrieve, save, and delete orders programmatically, as it provides standardized CRUD operations and automatically handles extension attributes like tax details, shipping assignments, and payment information.
It implements caching through an internal registry to optimize performance when the same order is accessed multiple times during a request.
Public Methods
- get()
- getList()
- delete()
- deleteById()
- save()
- _resetState()