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 
10 use \Magento\Framework\MessageQueue\Publisher\Config\PublisherConfigItem\Iterator;
11 
15 class Config implements ConfigInterface
16 {
22  private $iterator;
23 
29  public function __construct(Iterator $iterator)
30  {
31  $this->iterator = $iterator;
32  }
33 
37  public function getPublisher($topic)
38  {
39  $publisher = $this->iterator[$topic];
40  if (!$publisher) {
41  throw new LocalizedException(
42  new Phrase("Publisher '%publisher' is not declared.", ['publisher' => $topic])
43  );
44  }
45  return $publisher;
46  }
47 
51  public function getPublishers()
52  {
53  return $this->iterator;
54  }
55 }