Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
State.php
Go to the documentation of this file.
1 <?php
7 
12 class State extends \Magento\Backend\Block\Widget\Grid\Column
13 {
17  protected $_config;
18 
24  public function __construct(
25  \Magento\Backend\Block\Template\Context $context,
26  \Magento\Sales\Model\Order\Config $config,
27  array $data = []
28  ) {
29  parent::__construct($context, $data);
30 
31  $this->_config = $config;
32  }
33 
39  public function getFrameCallback()
40  {
41  return [$this, 'decorateState'];
42  }
43 
54  public function decorateState($value, $row, $column, $isExport)
55  {
56  $status = $row->getStatus();
57  if ($value) {
58  $cell = $value . '[' . $this->_config->getStateLabelByStateAndStatus($value, $status) . ']';
59  } else {
60  $cell = $value;
61  }
62  return $cell;
63  }
64 }
decorateState($value, $row, $column, $isExport)
Definition: State.php:54
$config
Definition: fraud_order.php:17
$value
Definition: gender.phtml:16
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Sales\Model\Order\Config $config, array $data=[])
Definition: State.php:24
$status
Definition: order_status.php:8