Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LinksConfigProvider.php
Go to the documentation of this file.
1 <?php
7 declare(strict_types=1);
8 
10 
15 {
19  private $linksConfiguration;
20 
26  private $objectManager;
27 
33  public function __construct(
34  array $linksConfiguration,
35  \Magento\Framework\ObjectManagerInterface $objectManager
36  ) {
37  $this->linksConfiguration = $linksConfiguration;
38  $this->objectManager = $objectManager;
39  }
40 
44  public function getConfig(): array
45  {
46  $config = [];
47  foreach ($this->linksConfiguration as $linkName => $className) {
48  $config[$linkName] = $this->createConfigProvider($className)->getConfig();
49  }
50  return $config;
51  }
52 
59  private function createConfigProvider($instance): ConfigInterface
60  {
61  return $this->objectManager->create($instance);
62  }
63 }
$objectManager
Definition: bootstrap.php:17
$config
Definition: fraud_order.php:17
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31