Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TopDestinationCountries.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
17  const CONFIG_DESTINATIONS_PATH = 'general/country/destinations';
18 
22  private $scopeConfig;
23 
27  public function __construct(ScopeConfigInterface $scopeConfig)
28  {
29  $this->scopeConfig = $scopeConfig;
30  }
31 
37  public function getTopDestinations()
38  {
39  $destinations = (string)$this->scopeConfig->getValue(
40  self::CONFIG_DESTINATIONS_PATH,
41  ScopeInterface::SCOPE_STORE
42  );
43  return !empty($destinations) ? explode(',', $destinations) : [];
44  }
45 }