|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author @jenschude <[email protected]> |
|
4
|
|
|
*/ |
|
5
|
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Request\Customers\Command; |
|
7
|
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\Context; |
|
9
|
|
|
use Commercetools\Core\Request\AbstractAction; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @package Commercetools\Core\Request\Customers\Command |
|
13
|
|
|
* @link https://docs.commercetools.com/http-api-projects-customers.html#remove-address |
|
14
|
|
|
* @method string getAddressId() |
|
15
|
|
|
* @method CustomerRemoveAddressAction setAddressId(string $addressId = null) |
|
16
|
|
|
* @method string getAction() |
|
17
|
|
|
* @method CustomerRemoveAddressAction setAction(string $action = null) |
|
18
|
|
|
* @method string getAddressKey() |
|
19
|
|
|
* @method CustomerRemoveAddressAction setAddressKey(string $addressKey = null) |
|
20
|
|
|
*/ |
|
21
|
|
|
class CustomerRemoveAddressAction extends AbstractAction |
|
22
|
|
|
{ |
|
23
|
6 |
|
public function fieldDefinitions() |
|
24
|
|
|
{ |
|
25
|
|
|
return [ |
|
26
|
6 |
|
'action' => [static::TYPE => 'string'], |
|
27
|
6 |
|
'addressId' => [static::TYPE => 'string'], |
|
28
|
6 |
|
'addressKey' => [static::TYPE => 'string'], |
|
29
|
|
|
]; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @param array $data |
|
34
|
|
|
* @param Context|callable $context |
|
35
|
|
|
*/ |
|
36
|
6 |
|
public function __construct(array $data = [], $context = null) |
|
37
|
|
|
{ |
|
38
|
6 |
|
parent::__construct($data, $context); |
|
39
|
6 |
|
$this->setAction('removeAddress'); |
|
40
|
6 |
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param $addressId |
|
44
|
|
|
* @param Context|callable $context |
|
45
|
|
|
* @return CustomerRemoveAddressAction |
|
46
|
|
|
*/ |
|
47
|
2 |
|
public static function ofAddressId($addressId, $context = null) |
|
48
|
|
|
{ |
|
49
|
2 |
|
return static::of($context)->setAddressId($addressId); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @param $addressKey |
|
54
|
|
|
* @param Context|callable $context |
|
55
|
|
|
* @return CustomerRemoveAddressAction |
|
56
|
|
|
*/ |
|
57
|
2 |
|
public static function ofAddressKey($addressKey, $context = null) |
|
58
|
|
|
{ |
|
59
|
2 |
|
return static::of($context)->setAddressKey($addressKey); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|