Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ReviewActions.php
Go to the documentation of this file.
1 <?php
7 
9 
16 class ReviewActions extends Column
17 {
22  public function prepareDataSource(array $dataSource)
23  {
24  $dataSource = parent::prepareDataSource($dataSource);
25 
26  if (empty($dataSource['data']['items'])) {
27  return $dataSource;
28  }
29 
30  foreach ($dataSource['data']['items'] as &$item) {
31  $item[$this->getData('name')]['edit'] = [
32  'href' => $this->context->getUrl(
33  'review/product/edit',
34  ['id' => $item['review_id'], 'productId' => $item['entity_id']]
35  ),
36  'label' => __('Edit'),
37  'hidden' => false,
38  ];
39  }
40 
41  return $dataSource;
42  }
43 }
__()
Definition: __.php:13