DI Preferences
The Store module defines many DI preferences to bind interfaces to concrete implementations. These are among the most fundamental bindings in Magento.
Core Service Bindings
| Interface | Implementation |
|---|---|
| StoreManagerInterface | Magento\Store\Model\StoreManager |
| StoreResolverInterface | Magento\Store\Model\StoreResolver |
| StoreRepositoryInterface | Magento\Store\Model\StoreRepository |
| WebsiteRepositoryInterface | Magento\Store\Model\WebsiteRepository |
| GroupRepositoryInterface | Magento\Store\Model\GroupRepository |
| StoreCookieManagerInterface | Magento\Store\Model\StoreCookieManager |
| StoreConfigManagerInterface | Magento\Store\Model\Service\StoreConfigManager |
Data Interface Bindings
| Interface | Implementation |
|---|---|
| Data\StoreInterface | Magento\Store\Model\Store |
| Data\WebsiteInterface | Magento\Store\Model\Website |
| Data\GroupInterface | Magento\Store\Model\Group |
| Data\StoreConfigInterface | Magento\Store\Model\Data\StoreConfig |
Framework Bindings
| Interface | Implementation |
|---|---|
| ScopeResolverInterface | Magento\Store\Model\Resolver\Store |
| App\ScopeResolverInterface | Magento\Store\Model\Resolver\Store |
| LocaleResolverInterface | Magento\Store\Model\Resolver\Locale |
| UrlModifierInterface | Magento\Store\Url\Plugin\RouteParamsResolver |
Plugins
The Store module defines several plugins that intercept core application behavior for store context management.
_scope and _scope_to_url parameters from
route params for multi-store URL generation.
Upgrade-Insecure-Requests header based on store configuration
to enforce HTTPS upgrade for browsers.
Virtual Types
The Store module defines virtual types for specialized collection fetching strategies and cached data access.
Configuration XML Example
Example of the di.xml structure showing how preferences and plugins are defined.
Observers
The Store module does not define its own events.xml file in the core module. However, other modules observe store-related events.
The Magento_Store module is a foundational module that other modules depend on.
It primarily uses the DI system (preferences and plugins) rather than the event/observer
pattern. Store-related events like store_add, store_delete,
and store_edit are dispatched but observed by other modules.
Events Dispatched by Store Module
| Event Name | Dispatched From | Data |
|---|---|---|
| store_add | Store::afterSave() | store object |
| store_edit | Store::afterSave() | store object |
| store_delete | Store::afterDelete() | store object |
| store_group_save | Group::afterSave() | group object |
| website_save_after | Website::afterSave() | website object |