Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HandlerFactory.php
Go to the documentation of this file.
1 <?php
7 
9 {
15  protected $objectManager;
16 
21  {
22  $this->objectManager = $objectManager;
23  }
24 
33  public function create($instance, array $arguments = [])
34  {
35  if (!is_subclass_of(
36  $instance,
37  \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\HandlerInterface::class
38  )
39  ) {
40  throw new \InvalidArgumentException(
41  $instance .
42  ' does not implement ' .
43  \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\HandlerInterface::class
44  );
45  }
46 
47  return $this->objectManager->create($instance, $arguments);
48  }
49 }
is_subclass_of($obj, $className)
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
$arguments