Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 1d4bf8c

Browse files
authored
Merge pull request #8402 from RakeshJesadiya/patch-100
Update proxies.md
2 parents 46dddbc + 4a5173e commit 1d4bf8c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/guides/v2.3/extension-dev-guide/proxies.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ With the proxy used in place of `SlowLoading`, the `SlowLoading` class will not
7373
Because DI configuration is used to inject a proxy, proxies can be dropped in to replace their corresponding classes - or proxy replacements _removed_ - without touching application code.
7474

7575
As a practical example of a proxy, you can see the [StoreManager]({{ site.mage2bloburl }}/{{ page.guide_version }}/app/code/Magento/Store/Model/StoreManager.php){:target="_blank"} class and then see the generated `StoreManager` proxy class.
76+
77+
The following excerpt from the Magento code passes the `storeManager` argument as a proxy to the `Magento\Store\Model\Resolver\Store` class. The `StoreManagerInterface` model is defined as a proxy class by the added `Proxy` at the end of the original class in the `di.xml` file.
78+
79+
```xml
80+
<type name="Magento\Store\Model\Resolver\Store">
81+
<arguments>
82+
<argument name="storeManager" xsi:type="object">Magento\Store\Model\StoreManagerInterface\Proxy</argument>
83+
</arguments>
84+
</type>
85+
```

0 commit comments

Comments
 (0)