1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
*/ |
4
|
|
|
|
5
|
|
|
namespace Commercetools\Core\Request\ProductTypes\Command; |
6
|
|
|
|
7
|
|
|
use Commercetools\Core\Model\Common\Context; |
8
|
|
|
use Commercetools\Core\Model\ProductType\AttributeDefinitionCollection; |
9
|
|
|
use Commercetools\Core\Request\AbstractAction; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @package Commercetools\Core\Request\ProductTypes\Command |
13
|
|
|
* @link https://docs.commercetools.com/http-api-projects-productTypes#change-the-order-of-attributedefinitions |
14
|
|
|
* @method string getAction() |
15
|
|
|
* @method ProductTypeChangeAttributeOrderByNameAction setAction(string $action = null) |
16
|
|
|
* @method AttributeDefinitionCollection getAttributes() |
17
|
|
|
* @method ProductTypeChangeAttributeOrderByNameAction setAttributes(AttributeDefinitionCollection $attributes = null) |
18
|
|
|
* @method array getAttributeNames() |
19
|
|
|
* @method ProductTypeChangeAttributeOrderByNameAction setAttributeNames(array $attributeNames = null) |
20
|
|
|
*/ |
21
|
|
|
class ProductTypeChangeAttributeOrderByNameAction extends AbstractAction |
22
|
|
|
{ |
23
|
3 |
|
public function fieldDefinitions() |
24
|
|
|
{ |
25
|
|
|
return [ |
26
|
3 |
|
'action' => [static::TYPE => 'string'], |
27
|
3 |
|
'attributeNames' => [static::TYPE => 'array'], |
28
|
|
|
]; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param array $data |
33
|
|
|
* @param Context|callable $context |
34
|
|
|
*/ |
35
|
3 |
|
public function __construct(array $data = [], $context = null) |
36
|
|
|
{ |
37
|
3 |
|
parent::__construct($data, $context); |
38
|
3 |
|
$this->setAction('changeAttributeOrderByName'); |
39
|
3 |
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @param array $attributeNames |
43
|
|
|
* @param Context|callable $context |
44
|
|
|
* @return ProductTypeChangeAttributeOrderByNameAction |
45
|
|
|
*/ |
46
|
1 |
|
public static function ofAttributeNames(array $attributeNames, $context = null) |
47
|
|
|
{ |
48
|
1 |
|
return static::of($context)->setAttributeNames($attributeNames); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|