Skip to content

Commit 201f6c5

Browse files
author
Vitaliy Boyko
committed
Changed the description of the preference template
1 parent b53c008 commit 201f6c5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

resources/fileTemplates/code/Magento Module DI Xml Preference.xml.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
1010
<tr>
1111
<td><font face="verdana" size="-1">
12-
The object manager uses mappings to determine what the default implementation is for a class in a constructor (scope dependent).
13-
For this goal where designed preference node in the di.xml settings file.
14-
For example:
15-
In class A here are dependencies in the constructor - interface B and class C.
16-
Our aim to get in the class A concrete realization of interface B - BConcrete and replace concrete implementation for class C on its child CSpecific.
17-
We can easily determine for object manager to instantiate interface B as concrete class BConcrete by using this template.
18-
In the same way, we can determine for object manager to instantiate class CSpecific instead of class C.
12+
The object manager uses abstraction-implementation mappings when the constructor signature of a class requests
13+
an object by its interface. The object manager uses these mappings to determine what the default implementation
14+
is for that class for a particular scope.
15+
</font><br>
16+
</td>
17+
</tr>
18+
<tr>
19+
<td><font face="verdana" size="-1">
20+
If you want to override a public or protected method from a core class, utilize the preference node from di.xml to achieve it.
1921
</font><br>
2022
</td>
2123
</tr>

0 commit comments

Comments
 (0)