Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Config.php
Go to the documentation of this file.
1 <?php
7 
11 
15 class Config implements ConfigInterface
16 {
20  protected $data;
21 
28  {
29  $this->data = $configData;
30  }
31 
35  public function getTopic($topicName)
36  {
37  $data = $this->data->get(self::TOPICS . '/' . $topicName);
38  if ($data === null) {
39  throw new LocalizedException(
40  new Phrase('Topic "%topic" is not configured.', ['topic' => $topicName])
41  );
42  }
43  return $data;
44  }
45 
49  public function getTopicHandlers($topicName)
50  {
51  $topicData = $this->getTopic($topicName);
52  return $topicData[self::TOPIC_HANDLERS];
53  }
54 
58  public function getTopics()
59  {
60  return $this->data->get(self::TOPICS) ?: [];
61  }
62 }
__construct(ConfigData $configData)
Definition: Config.php:27