ObjectManager教程
https://bsscommerce.com/confluence/quick-overview-of-object-manager-in-magento-2/
1)构造方法 constructor
\Magento\Framework\ObjectManagerInterface
2)phtml中调用(不推荐仅限debug)
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
get()
返回singleton object
适用于单例共享组件、获取对象工厂
create()
返回new object
适用于接口
create vs get
$_objectManager->create() creates new instance of the object, no-matter-what
$_objectManager->get() first tries to find shared instance (already created), if it’s not found - it just creates new shared instance