b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / app / code / Amasty / Paction / Model /
Filename/home/dev2.destoffenstraat.com/app/code/Amasty/Paction/Model/CommandResolver.php
Size1.23 kb
Permissionrw-r--r--
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified26-Jul-2025 18:05
Last accessed22-Aug-2025 20:55
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php

declare(strict_types=1);

/**
* @author Amasty Team
* @copyright Copyright (c) 2023 Amasty (https://www.amasty.com)
* @package Mass Product Actions for Magento 2
*/

namespace Amasty\Paction\Model;

use Magento\Backend\Model\Url;

class CommandResolver
{
/**
* @var array
*/
protected $commands = [];

/**
* @var string
*/
protected $actionUrl;

public function __construct(
Url $urlBuilder,
array $commands = []
) {
$this->actionUrl = $urlBuilder->getUrl('amasty_paction/massaction/index');
$this->commands = $commands;
}

public function getCommand(string $name): ?Command
{
return $this->commands[$name] ?? null;
}

public function getCommandDataByName(string $name): array
{
/* initialization for delimiter lines*/
$data = [
'confirm_title' => '',
'confirm_message' => '',
'type' => $name,
'label' => '------------',
'url' => '',
'fieldLabel' => ''
];

if ($command = $this->getCommand($name)) {
$data = $command->getCreationData();
$data['url'] = $this->actionUrl;
}

return $data;
}
}