Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/vendor/magento/module-review/Ui/Component/Listing/Columns/
Upload File :
Current File : //home/rtorresani/www/vendor/magento/module-review/Ui/Component/Listing/Columns/ReviewActions.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Review\Ui\Component\Listing\Columns;

use Magento\Ui\Component\Listing\Columns\Column;

/**
 * Class ReviewActions
 *
 * @api
 * @since 100.1.0
 */
class ReviewActions extends Column
{
    /**
     * {@inheritdoc}
     * @since 100.1.0
     */
    public function prepareDataSource(array $dataSource)
    {
        $dataSource = parent::prepareDataSource($dataSource);

        if (empty($dataSource['data']['items'])) {
            return $dataSource;
        }

        foreach ($dataSource['data']['items'] as &$item) {
            $item[$this->getData('name')]['edit'] = [
                'href' => $this->context->getUrl(
                    'review/product/edit',
                    ['id' => $item['review_id'], 'productId' => $item['entity_id']]
                ),
                'label' => __('Edit'),
                'hidden' => false,
            ];
        }

        return $dataSource;
    }
}