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
8 
12 class Factory
13 {
19  protected $objectManager;
20 
27  {
28  $this->objectManager = $objectManager;
29  }
30 
39  public function create($className, array $arguments = [])
40  {
41  $adjustment = $this->objectManager->create($className, $arguments);
42  if (!$adjustment instanceof AdjustmentInterface) {
43  throw new \InvalidArgumentException(
44  $className . ' doesn\'t implement \Magento\Framework\Pricing\Adjustment\AdjustmentInterface'
45  );
46  }
47  return $adjustment;
48  }
49 }
create($className, array $arguments=[])
Definition: Factory.php:39
$arguments
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
Definition: Factory.php:26
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31