Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SaveHandlerFactory.php
Go to the documentation of this file.
1 <?php
7 
10 
16 {
20  protected $objectManager;
21 
26  {
27  $this->objectManager = $objectManager;
28  }
29 
38  public function create($saveHandlerClass, $arguments = [])
39  {
40  $handler = $this->objectManager->create($saveHandlerClass, $arguments);
41  if (!$handler instanceof SaveHandlerInterface) {
42  throw new \InvalidArgumentException(
43  $saveHandlerClass . ' doesn\'t implement \Magento\Framework\IndexerInterface'
44  );
45  }
46 
47  return $handler;
48  }
49 }
__construct(ObjectManagerInterface $objectManager)
create($saveHandlerClass, $arguments=[])
$arguments
catch(\Exception $e) $handler
Definition: index.php:30