AD0-E716 · Question #9
An Adobe Commerce developer is developing a custom module. As part of their implementation they have decided that all instances of their Custom\Module\Model\Example class should receive a new…
The correct answer is B. Option B. The developer can achieve this by adding the following configuration to their di.xml file: <component name="Custom\Module\Model\Example" factory="Custom\Module\Model\ExampleFactory"> <argument name="filesystemAdapter" type="Magento\Filesystem\Adapter\Local" /> This…
Question
An Adobe Commerce developer is developing a custom module. As part of their implementation they have decided that all instances of their Custom\Module\Model\Example class should receive a new instance of Magento\Filesystem\Adapter\Local. How would the developer achieve this using di. xml? A) B) C)
Options
- AOption A
- BOption B
- COption C
How the community answered
(21 responses)- A10% (2)
- B86% (18)
- C5% (1)
Explanation
The developer can achieve this by adding the following configuration to their di.xml file: <component name="Custom\Module\Model\Example" factory="Custom\Module\Model\ExampleFactory"> <argument name="filesystemAdapter" type="Magento\Filesystem\Adapter\Local" /> This configuration will ensure that all instances of the Custom\Module\Model\Example class will receive a new instance of the Magento\Filesystem\Adapter\Local class.
Topics
Community Discussion
No community discussion yet for this question.