Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ChannelDataBuilder.php
Go to the documentation of this file.
1 <?php
7 
12 
17 {
21  private static $channel = 'channel';
22 
26  private static $channelValue = 'Magento2_Cart_%s_BT';
27 
31  private $productMetadata;
32 
36  private $config;
37 
44  public function __construct(ProductMetadataInterface $productMetadata, Config $config = null)
45  {
46  $this->productMetadata = $productMetadata;
47  $this->config = $config ?: ObjectManager::getInstance()->get(Config::class);
48  }
49 
53  public function build(array $buildSubject)
54  {
55  $channel = $this->config->getValue('channel');
56  return [
57  self::$channel => $channel ?: sprintf(self::$channelValue, $this->productMetadata->getEdition())
58  ];
59  }
60 }
__construct(ProductMetadataInterface $productMetadata, Config $config=null)