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
9 
11 {
15  protected $objectManager = null;
16 
20  protected $instanceName = null;
21 
26  public function __construct(
28  $instanceName = \Magento\Framework\Mail\TemplateInterface::class
29  ) {
30  $this->objectManager = $objectManager;
31  $this->instanceName = $instanceName;
32  }
33 
37  public function get($identifier, $namespace = null)
38  {
39  return $this->objectManager->create(
40  $namespace ? $namespace : $this->instanceName,
41  ['data' => ['template_id' => $identifier]]
42  );
43  }
44 }
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName=\Magento\Framework\Mail\TemplateInterface::class)
Definition: Factory.php:26