/**
  * Returns the order statuses for field order_statuses.
  *
  * @return array
  */
 public function toOptionArray()
 {
     $statuses = $this->status->toOptionArray();
     if (!empty($statuses) && $statuses[0]['value'] == '') {
         array_shift($statuses);
     }
     $options[] = ['label' => __('---- Default Option ----'), 'value' => '0'];
     foreach ($statuses as $status) {
         $options[] = ['value' => $status['value'], 'label' => $status['label']];
     }
     return $options;
 }
 /**
  * Retrieve order statuses as options for select
  *
  * @see \Magento\Sales\Model\Config\Source\Order\Status:toOptionArray()
  * @return array
  */
 public function toOptionArray()
 {
     $options = parent::toOptionArray();
     array_shift($options);
     // Remove '--please select--' option
     return $options;
 }
Esempio n. 3
0
 /**
  * @return array
  */
 public function toOptionArray()
 {
     $options = parent::toOptionArray();
     if (isset($options[0]) && !$options[0]['value']) {
         unset($options[0]);
     }
     return $options;
 }
Esempio n. 4
0
 public function testToOptionArray()
 {
     $this->config->expects($this->once())->method('getStateStatuses')->will($this->returnValue(['status1', 'status2']));
     $this->assertEquals([['value' => '', 'label' => '-- Please Select --'], ['value' => 0, 'label' => 'status1'], ['value' => 1, 'label' => 'status2']], $this->object->toOptionArray());
 }