Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TMapFactory.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  private $objectManager;
19 
24  public function __construct(ObjectManagerInterface $objectManager)
25  {
26  $this->objectManager = $objectManager;
27  }
28 
33  public function create(array $args)
34  {
35  return $this->objectManager->create(TMap::class, $args);
36  }
37 
42  public function createSharedObjectsMap(array $args)
43  {
44  return $this->objectManager->create(
45  TMap::class,
46  array_merge(
47  $args,
48  [
49  'objectCreationStrategy' => function (ObjectManagerInterface $om, $objectName) {
50  return $om->get($objectName);
51  }
52  ]
53  )
54  );
55  }
56 }
$objectManager
Definition: bootstrap.php:17
__construct(ObjectManagerInterface $objectManager)
Definition: TMapFactory.php:24
$om