Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompilerFactory.php
Go to the documentation of this file.
1 <?php
7 
11 
16 {
22  protected $objectManager;
23 
29  protected $instanceName;
30 
38  {
39  $this->objectManager = $objectManager;
40  $this->instanceName = $instanceName;
41  }
42 
50  public function create(array $arguments = [])
51  {
52  $object = $this->objectManager->create($this->instanceName, $arguments);
53 
54  if (!($object instanceof CompilerInterface)) {
55  throw new LocalizedException(new Phrase('This class must implement the "CompilerInterface"'));
56  }
57 
58  return $object;
59  }
60 }
$arguments
__construct(ObjectManagerInterface $objectManager, $instanceName)