Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Service.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  private $_importConfig;
14 
18  private $_options;
19 
23  public function __construct(\Magento\Directory\Model\Currency\Import\Config $importConfig)
24  {
25  $this->_importConfig = $importConfig;
26  }
27 
31  public function toOptionArray()
32  {
33  if ($this->_options === null) {
34  $this->_options = [];
35  foreach ($this->_importConfig->getAvailableServices() as $serviceName) {
36  $this->_options[] = [
37  'label' => $this->_importConfig->getServiceLabel($serviceName),
38  'value' => $serviceName,
39  ];
40  }
41  }
42  return $this->_options;
43  }
44 }
__construct(\Magento\Directory\Model\Currency\Import\Config $importConfig)
Definition: Service.php:23