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\Store; |
8
|
|
|
use Commercetools\Core\Model\Store\StoreReference; |
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#add-store-beta |
15
|
|
|
* |
16
|
|
|
* @method string getAction() |
17
|
|
|
* @method CustomerAddStoreAction setAction(string $action = null) |
18
|
|
|
* @method StoreReference getStore() |
19
|
|
|
* @method CustomerAddStoreAction setStore(StoreReference $store = null) |
20
|
|
|
*/ |
21
|
|
|
class CustomerAddStoreAction extends AbstractAction |
22
|
|
|
{ |
23
|
|
|
use LocaleTrait; |
24
|
|
|
|
25
|
3 |
|
public function fieldDefinitions() |
26
|
|
|
{ |
27
|
|
|
return [ |
28
|
3 |
|
'action' => [static::TYPE => 'string'], |
29
|
3 |
|
'store' => [static::TYPE => StoreReference::class] |
30
|
|
|
]; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param array $data |
35
|
|
|
* @param Context|callable $context |
36
|
|
|
*/ |
37
|
3 |
|
public function __construct(array $data = [], $context = null) |
38
|
|
|
{ |
39
|
3 |
|
parent::__construct($data, $context); |
40
|
3 |
|
$this->setAction('addStore'); |
41
|
3 |
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param StoreReference $store |
45
|
|
|
* @param Context|callable $context |
46
|
|
|
* @return CustomerAddStoreAction |
47
|
|
|
*/ |
48
|
1 |
|
public static function ofStore(StoreReference $store, $context = null) |
49
|
|
|
{ |
50
|
1 |
|
return static::of($context)->setStore($store); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|