Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractMethod.php
Go to the documentation of this file.
1 <?php
7 
12 {
18  protected $_contentType;
19 
25  protected $_noneMethod = false;
26 
30  public function toOptionArray()
31  {
32  /* @var $carrierModel \Magento\Dhl\Model\Carrier */
33  $carrierModel = $this->_shippingDhl;
34  $dhlProducts = $carrierModel->getDhlProducts($this->_contentType);
35 
36  $options = [];
37  foreach ($dhlProducts as $code => $title) {
38  $options[] = ['value' => $code, 'label' => $title];
39  }
40 
41  if ($this->_noneMethod) {
42  array_unshift($options, ['value' => '', 'label' => __('None')]);
43  }
44 
45  return $options;
46  }
47 }
$title
Definition: default.phtml:14
__()
Definition: __.php:13
$code
Definition: info.phtml:12