InvoiceRepository
Magento\Sales\Model\Order\InvoiceRepository
What it does
The InvoiceRepository class provides a centralized way to manage invoice operations in Magento 2, including creating, retrieving, saving, and deleting invoices.
Developers use this class when they need to work with invoice data programmatically, such as fetching invoices by ID, searching invoices with filters, or persisting invoice changes.
It implements the repository pattern, providing a clean API for invoice CRUD operations while handling caching and data persistence.
Public Methods
- get()
- create()
- getList()
- delete()
- deleteById()
- save()