Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Factory.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Eav\Model\Form;
7 
13 class Factory
14 {
18  protected $_objectManager;
19 
25  {
26  $this->_objectManager = $objectManager;
27  }
28 
37  public function create($form, array $data = [])
38  {
39  $formInstance = $this->_objectManager->create($form, $data);
40  if (false == $formInstance instanceof \Magento\Eav\Model\Form) {
41  throw new \InvalidArgumentException($form . ' is not instance of \Magento\Eav\Model\Form');
42  }
43  return $formInstance;
44  }
45 }
$objectManager
Definition: bootstrap.php:17
create($form, array $data=[])
Definition: Factory.php:37
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition: Factory.php:24