How does objectmanager instantiated by objectmanagerinterface?
-
28-02-2021 - |
Pergunta
I always see objectmanager instantiated by objectmanagerinterface. But I never found di.xml that have preference of objectmanagerinterface to objectmanager.
Is it something I have never found? Or is objectmanager some special object that doesn't need di.xml?
Solução
Refer to this line from the object manager class:
There is somewhere (not sure exactly where), but really early in the application a call to instantiate the Object manager class (not referred via interface), and when the OM gets instantiated it adds the mapping from the interface to itself.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange