Log in
Model

Emulation

Magento\Store\Model\App\Emulation

What it does

The Emulation class allows developers to temporarily switch the store context, design theme, locale, and translation settings to emulate a different store environment.

This is commonly used in backend processes like email sending, API calls, or cron jobs where you need to render content or perform operations as if you were in a specific store's frontend context, then restore the original environment afterward.

Public Methods

  • startEnvironmentEmulation()
  • stopEnvironmentEmulation()
  • storeCurrentEnvironmentInfo()
  • _resetState()