Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MessageConfigurationsPool.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  private $configurationsMap;
14 
21  public function __construct(
22  array $configurationsMap = []
23  ) {
24  array_walk(
25  $configurationsMap,
26  function (array &$configuration) {
27  if (!isset($configuration['renderer'])
28  || !is_string($configuration['renderer'])
29  ) {
30  throw new \InvalidArgumentException('Renderer should be defined.');
31  }
32 
33  if (isset($configuration['data'])
34  && !is_array($configuration['data'])
35  ) {
36  throw new \InvalidArgumentException('Data should be of array type.');
37  }
38 
39  if (!isset($configuration['data'])) {
40  $configuration['data'] = [];
41  }
42  }
43  );
44 
45  $this->configurationsMap = $configurationsMap;
46  }
47 
55  public function getMessageConfiguration($identifier)
56  {
57  return !isset($this->configurationsMap[$identifier])
58  ? null
59  : $this->configurationsMap[$identifier];
60  }
61 }
$configuration
Definition: index.php:33