Log in
Model

EntityStorage

Magento\Sales\Model\EntityStorage

What it does

EntityStorage provides an in-memory registry for storing and retrieving sales entities (like orders, invoices, shipments) during a single request lifecycle.

Developers use it to avoid redundant database queries by caching entities and retrieving them either by ID or by a combination of identifying fields.

It's particularly useful in order processing workflows where the same entities are accessed multiple times.

Public Methods

  • addByIdentifyingFields()
  • add()
  • get()
  • getByIdentifyingFields()
  • remove()
  • has()