Suppose there are 3 classes: Class A, B and C. Class C have dependecy of Class A You need to overrride/change an argument of class A, create an object of it and inject in Class B in such a way that it should not affect the class C.
What should be the magento standard way to do this:
A. In module’s etc/di.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
B. In module’s etc/config.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
C. In module’s etc/system.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
D. In module’s etc/menu.xml, define virtualType node to override argument and create a subclass of A. Then use type node to pass the subclass A object into class B.
Notifications
Clear all
Topic starter
Suggested Answer: A
Posted : 04/01/2023 6:12 am