|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Commercetools\Core\Request\Customers\Command; |
|
4
|
|
|
|
|
5
|
|
|
use Commercetools\Core\Model\Common\Context; |
|
6
|
|
|
use Commercetools\Core\Model\Common\LocaleTrait; |
|
7
|
|
|
use Commercetools\Core\Model\Store\StoreReference; |
|
8
|
|
|
use Commercetools\Core\Model\Store\StoreReferenceCollection; |
|
9
|
|
|
use Commercetools\Core\Request\AbstractAction; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @package Commercetools\Core\Request\Customers\Command |
|
13
|
|
|
* |
|
14
|
|
|
* @link https://docs.commercetools.com/http-api-projects-customers.html#set-stores-beta |
|
15
|
|
|
* |
|
16
|
|
|
* @method string getAction() |
|
17
|
|
|
* @method CustomerSetStoresAction setAction(string $action = null) |
|
18
|
|
|
* @method StoreReferenceCollection getStores() |
|
19
|
|
|
* @method CustomerSetStoresAction setStores(StoreReferenceCollection $stores = null) |
|
20
|
|
|
*/ |
|
21
|
|
|
class CustomerSetStoresAction extends AbstractAction |
|
22
|
|
|
{ |
|
23
|
|
|
use LocaleTrait; |
|
24
|
|
|
|
|
25
|
3 |
|
public function fieldDefinitions() |
|
26
|
|
|
{ |
|
27
|
|
|
return [ |
|
28
|
3 |
|
'action' => [static::TYPE => 'string'], |
|
29
|
3 |
|
'stores' => [static::TYPE => StoreReferenceCollection::class], |
|
30
|
|
|
]; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param StoreReferenceCollection $stores |
|
35
|
|
|
* @param Context|callable $context |
|
36
|
|
|
* @return CustomerSetStoresAction |
|
37
|
|
|
*/ |
|
38
|
1 |
|
public static function ofStores(StoreReferenceCollection $stores, $context = null) |
|
39
|
|
|
{ |
|
40
|
1 |
|
return static::of($context)->setStores($stores); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @param array $data |
|
45
|
|
|
* @param Context|callable $context |
|
46
|
|
|
*/ |
|
47
|
3 |
|
public function __construct(array $data = [], $context = null) |
|
48
|
|
|
{ |
|
49
|
3 |
|
parent::__construct($data, $context); |
|
50
|
3 |
|
$this->setAction('setStores'); |
|
51
|
3 |
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|