Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BackendFactory.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 
37  public function create($modelName, array $arguments = [])
38  {
39  $model = $this->_objectManager->create($modelName, $arguments);
40  if (!$model instanceof \Magento\Framework\App\Config\ValueInterface) {
41  throw new \InvalidArgumentException('Invalid config field backend model: ' . $modelName);
42  }
43  return $model;
44  }
45 }
create($modelName, array $arguments=[])
$arguments
__construct(\Magento\Framework\ObjectManagerInterface $objectmanager)