Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/extmag/shiplab/Ui/Component/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/extmag/shiplab/Ui/Component/LabelsDataProvider.php
<?php
/**
 * Copyright © Extmag. All rights reserved.
 */

namespace Extmag\Shiplab\Ui\Component;

use Magento\Backend\Model\UrlInterface;
use Magento\Framework\Api\FilterBuilder;
use Magento\Framework\Api\Search\SearchCriteriaBuilder;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\AuthorizationInterface;
use Magento\Framework\View\Element\UiComponent\DataProvider\Reporting;

class LabelsDataProvider extends DataProvider
{
    /**
     * @var UrlInterface
     */
    protected $url;

    public function __construct(
        $name,
        $primaryFieldName,
        $requestFieldName,
        Reporting $reporting,
        SearchCriteriaBuilder $searchCriteriaBuilder,
        RequestInterface $request,
        FilterBuilder $filterBuilder,
        AuthorizationInterface $authorization,
        UrlInterface $url,
        array $meta = [],
        array $data = [],
        array $additionalFilterPool = []
    ) {
        parent::__construct(
            $name,
            $primaryFieldName,
            $requestFieldName,
            $reporting,
            $searchCriteriaBuilder,
            $request,
            $filterBuilder,
            $authorization,
            $meta,
            $data,
            $additionalFilterPool
        );
        $this->url = $url;
    }

    /**
     * @return array
     */
    public function getData()
    {
        $data = parent::getData();
        foreach ($data['items'] as & $item) {
            $item['order_link'] = $this->url->getUrl('sales/order/view', ['order_id' => $item['order_id']]);
            if ($item['order_sub_type'] == 'shipment') {
                $item['order_sub_link'] = $this->url->getUrl(
                    'sales/shipment/view',
                    ['shipment_id' => $item['order_sub_id']]
                );
            } elseif ($item['order_sub_type'] == 'refund') {
                $item['order_sub_link'] = $this->url->getUrl(
                    'sales/creditmemo/view',
                    ['creditmemo_id' => $item['order_sub_id']]
                );
            } else {
                $item['order_sub_link'] = $this->url->getUrl('sales/order/view', ['order_id' => $item['order_sub_id']]);
            }
            $item['customer_link'] = $this->url->getUrl('customer/index/edit', ['id' => $item['customer_id']]);
        }

        return $data;
    }
}

Spamworldpro Mini