1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Commercetools\Core\Request\Stores\Command; |
4
|
|
|
|
5
|
|
|
use Commercetools\Core\Model\Channel\ChannelReference; |
6
|
|
|
use Commercetools\Core\Model\Common\Context; |
7
|
|
|
use Commercetools\Core\Request\AbstractAction; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* @package Commercetools\Core\Request\Stores\Command |
11
|
|
|
* @link https://docs.commercetools.com/api/projects/stores#remove-supply-channel |
12
|
|
|
* |
13
|
|
|
* @method string getAction() |
14
|
|
|
* @method StoreRemoveSupplyChannelAction setAction(string $action = null) |
15
|
|
|
* @method ChannelReference getSupplyChannel() |
16
|
|
|
* @method StoreRemoveSupplyChannelAction setSupplyChannel(ChannelReference $supplyChannel = null) |
17
|
|
|
*/ |
18
|
|
|
class StoreRemoveSupplyChannelAction extends AbstractAction |
19
|
|
|
{ |
20
|
|
|
public function fieldDefinitions() |
21
|
|
|
{ |
22
|
|
|
return [ |
23
|
|
|
'action' => [static::TYPE => 'string'], |
24
|
|
|
'supplyChannel' => [static::TYPE => ChannelReference::class], |
25
|
|
|
]; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @param array $data |
30
|
|
|
* @param Context|callable $context |
31
|
|
|
*/ |
32
|
|
|
public function __construct(array $data = [], $context = null) |
33
|
|
|
{ |
34
|
|
|
parent::__construct($data, $context); |
35
|
|
|
$this->setAction('removeSupplyChannel'); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @param ChannelReference $supplyChannel |
40
|
|
|
* @param Context|callable $context |
41
|
|
|
* @return StoreRemoveSupplyChannelAction |
42
|
|
|
*/ |
43
|
|
|
public static function ofSupplyChannel(ChannelReference $supplyChannel, $context = null) |
44
|
|
|
{ |
45
|
|
|
StoreRemoveSupplyChannelAction::class; |
46
|
|
|
return static::of($context)->setSupplyChannel($supplyChannel); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|