Accessing data provider via PHP¶
Catalog Data Provider Service¶
Example usage in Controller or services:
1 2 3 4 5 6 7 8 9 10 11 |
|
This service injects different data providers to the Catalog Service using external configuration. You can choose the provider depending on SiteAccess, URL, etc.
Implementation¶
To choose the proper catalog provider, use tags and compiler pass.
Compiler pass¶
New compiler pass (CatalogDataProviderOperationsPass
) collects all services which are tagged with catalog_data_provider_operation
.
For example:
<tag name="catalog_data_provider_operation" alias="ez5" />
The compiler pass calls setDataProviderService
from CatalogDataProviderService
and sets all available providers.
When the actual call to catalog data provider service is made, the proper provider is chosen depending on the SiteAccess.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|