Model
OrderRepository
Magento\Sales\Model\OrderRepository
What it does
OrderRepository is the main class for managing order data in Magento 2.
Developers use it to retrieve, save, delete, and search for orders using standardized CRUD operations.
It handles loading order details including tax information, shipping assignments, and payment data, making it the recommended way to interact with orders programmatically instead of directly accessing the database.
Public Methods
- get()
- getList()
- delete()
- deleteById()
- save()
- _resetState()