Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ButtonProviderFactory.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  protected $objectManager;
19 
26  {
27  $this->objectManager = $objectManager;
28  }
29 
37  public function create($providerClass, array $arguments = [])
38  {
39  $object = $this->objectManager->create($providerClass, ['arguments' => $arguments]);
40  if (!$object instanceof ButtonProviderInterface) {
41  throw new \InvalidArgumentException(
42  sprintf('"%s" must implement the interface ButtonProviderInterface.', $providerClass)
43  );
44  }
45 
46  return $object;
47  }
48 }
$arguments