Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SourceFactory.php
Go to the documentation of this file.
1 <?php
7 
13 {
19  protected $_objectManager;
20 
24  public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager)
25  {
26  $this->_objectManager = $objectManager;
27  }
28 
35  public function create($modelName)
36  {
37  $model = $this->_objectManager->get($modelName);
38  return $model;
39  }
40 }
$objectManager
Definition: bootstrap.php:17
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)