| 1 | <?php |
||
| 11 | class Methods implements ArrayInterface |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var Carrier $carrier |
||
| 16 | */ |
||
| 17 | protected $carrier; |
||
| 18 | |||
| 19 | 2 | public function __construct(Carrier $carrier) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Sets the option array for the small and medium |
||
| 26 | * parcel option in admin section of the extension |
||
| 27 | * |
||
| 28 | * @return array |
||
| 29 | */ |
||
| 30 | 2 | public function toOptionArray() |
|
| 31 | { |
||
| 32 | 2 | $methods = $this->carrier->getMethods(); |
|
| 33 | |||
| 34 | 2 | $options = []; |
|
| 35 | 2 | foreach ($methods as $value => $label) { |
|
| 36 | 2 | $options[] = ['value' => $value, 'label' => $label]; |
|
| 37 | 2 | } |
|
| 38 | |||
| 39 | 2 | return $options; |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Get options in "key-value" format |
||
| 44 | * |
||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | public function toArray() |
||
| 53 | } |
||
| 54 |