Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
DataFactory.php
Go to the documentation of this file.
1 <?php
9 
11 {
17  protected $_objectManager;
18 
24  protected $_instanceName = null;
25 
30  public function __construct(
32  $instanceName = \Magento\Framework\App\Config\Data::class
33  ) {
34  $this->_objectManager = $objectManager;
35  $this->_instanceName = $instanceName;
36  }
37 
44  public function create(array $data = [])
45  {
46  return $this->_objectManager->create($this->_instanceName, $data);
47  }
48 }
$objectManager
Definition: bootstrap.php:17
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName=\Magento\Framework\App\Config\Data::class)
Definition: DataFactory.php:30