How would the developer achieve this using di. xml?

An Adobe Commerce developer is developing a custom module. As part of their implementation they have decided that all instances of their CustomModuleModelExample class should receive a new instance of MagentoFilesystemAdapterLocal.

How would the developer achieve this using di. xml?

A)

B)

C)

A . Option A
B. Option B
C. Option C

Answer: B

Explanation:

The developer can achieve this by adding the following configuration to their di.xml file:

XML

<config>

<component name="CustomModuleModelExample"

factory="CustomModuleModelExampleFactory">

<arguments>

<argument name="filesystemAdapter" type="MagentoFilesystemAdapterLocal" /> </arguments>

</component>

</config>

This configuration will ensure that all instances of the CustomModuleModelExample class will receive a new instance of the MagentoFilesystemAdapterLocal class.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments