|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author @jenschude <[email protected]> |
|
4
|
|
|
*/ |
|
5
|
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Builder\Request; |
|
7
|
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\TaxCategory\TaxCategory; |
|
9
|
|
|
use Commercetools\Core\Model\TaxCategory\TaxCategoryDraft; |
|
10
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryByIdGetRequest; |
|
11
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryByKeyGetRequest; |
|
12
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryCreateRequest; |
|
13
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryDeleteByKeyRequest; |
|
14
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryDeleteRequest; |
|
15
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryQueryRequest; |
|
16
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryUpdateByKeyRequest; |
|
17
|
|
|
use Commercetools\Core\Request\TaxCategories\TaxCategoryUpdateRequest; |
|
18
|
|
|
|
|
19
|
|
|
class TaxCategoryRequestBuilder |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @return TaxCategoryQueryRequest |
|
23
|
|
|
*/ |
|
24
|
1 |
|
public function query() |
|
25
|
|
|
{ |
|
26
|
1 |
|
return TaxCategoryQueryRequest::of(); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param TaxCategory $taxCategory |
|
31
|
|
|
* @return TaxCategoryUpdateRequest |
|
32
|
|
|
*/ |
|
33
|
1 |
|
public function update(TaxCategory $taxCategory) |
|
34
|
|
|
{ |
|
35
|
1 |
|
return TaxCategoryUpdateRequest::ofIdAndVersion($taxCategory->getId(), $taxCategory->getVersion()); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @param TaxCategory $taxCategory |
|
40
|
|
|
* @return TaxCategoryUpdateByKeyRequest |
|
41
|
|
|
*/ |
|
42
|
1 |
|
public function updateByKey(TaxCategory $taxCategory) |
|
43
|
|
|
{ |
|
44
|
1 |
|
return TaxCategoryUpdateByKeyRequest::ofKeyAndVersion($taxCategory->getKey(), $taxCategory->getVersion()); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @param TaxCategoryDraft $taxCategoryDraft |
|
49
|
|
|
* @return TaxCategoryCreateRequest |
|
50
|
|
|
*/ |
|
51
|
1 |
|
public function create(TaxCategoryDraft $taxCategoryDraft) |
|
52
|
|
|
{ |
|
53
|
1 |
|
return TaxCategoryCreateRequest::ofDraft($taxCategoryDraft); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @param TaxCategory $taxCategory |
|
58
|
|
|
* @return TaxCategoryDeleteRequest |
|
59
|
|
|
*/ |
|
60
|
1 |
|
public function delete(TaxCategory $taxCategory) |
|
61
|
|
|
{ |
|
62
|
1 |
|
return TaxCategoryDeleteRequest::ofIdAndVersion($taxCategory->getId(), $taxCategory->getVersion()); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param TaxCategory $taxCategory |
|
67
|
|
|
* @return TaxCategoryDeleteByKeyRequest |
|
68
|
|
|
*/ |
|
69
|
1 |
|
public function deleteByKey(TaxCategory $taxCategory) |
|
70
|
|
|
{ |
|
71
|
1 |
|
return TaxCategoryDeleteByKeyRequest::ofKeyAndVersion($taxCategory->getKey(), $taxCategory->getVersion()); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @param string $id |
|
76
|
|
|
* @return TaxCategoryByIdGetRequest |
|
77
|
|
|
*/ |
|
78
|
1 |
|
public function getById($id) |
|
79
|
|
|
{ |
|
80
|
1 |
|
return TaxCategoryByIdGetRequest::ofId($id); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @param string $key |
|
85
|
|
|
* @return TaxCategoryByKeyGetRequest |
|
86
|
|
|
*/ |
|
87
|
1 |
|
public function getByKey($key) |
|
88
|
|
|
{ |
|
89
|
1 |
|
return TaxCategoryByKeyGetRequest::ofKey($key); |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
|