|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @file |
|
5
|
|
|
* Magento API Client (SOAP v1). |
|
6
|
|
|
* Allows wrappers for each call, dependencies injections |
|
7
|
|
|
* and code completion. |
|
8
|
|
|
* |
|
9
|
|
|
* @author Sébastien MALOT <[email protected]> |
|
10
|
|
|
* @license MIT |
|
11
|
|
|
* @url <https://github.com/smalot/magento-client> |
|
12
|
|
|
* |
|
13
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
14
|
|
|
* file that was distributed with this source code. |
|
15
|
|
|
*/ |
|
16
|
|
|
|
|
17
|
|
|
namespace Smalot\Magento\Catalog; |
|
18
|
|
|
|
|
19
|
|
|
use Smalot\Magento\ActionInterface; |
|
20
|
|
|
use Smalot\Magento\MagentoModuleAbstract; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class ProductMedia |
|
24
|
|
|
* |
|
25
|
|
|
* @package Smalot\Magento\Catalog |
|
26
|
|
|
*/ |
|
27
|
|
|
class ProductMedia extends MagentoModuleAbstract |
|
28
|
|
|
{ |
|
29
|
|
|
/** |
|
30
|
|
|
* Allows you to upload a new product image. |
|
31
|
|
|
* |
|
32
|
|
|
* @param string $product |
|
33
|
|
|
* @param array $data |
|
34
|
|
|
* @param string $storeView |
|
35
|
|
|
* @param string $identifierType |
|
36
|
|
|
* |
|
37
|
|
|
* @return ActionInterface |
|
38
|
|
|
*/ |
|
39
|
|
|
public function create($product, $data, $storeView = null, $identifierType = null) |
|
|
|
|
|
|
40
|
|
|
{ |
|
41
|
|
|
return $this->__createAction('catalog_product_attribute_media.create', func_get_args()); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Allows you to set/get the current store view. |
|
46
|
|
|
* |
|
47
|
|
|
* @param string $storeView |
|
48
|
|
|
* |
|
49
|
|
|
* @return ActionInterface |
|
50
|
|
|
*/ |
|
51
|
|
|
public function setCurrentStore($storeView) |
|
|
|
|
|
|
52
|
|
|
{ |
|
53
|
|
|
return $this->__createAction('catalog_product_attribute_media.currentStore', func_get_args()); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Allows you to retrieve information about the specified product image. |
|
58
|
|
|
* |
|
59
|
|
|
* @param string $productId |
|
60
|
|
|
* @param string $file |
|
61
|
|
|
* @param string $storeView |
|
62
|
|
|
* @param string $identifierType |
|
63
|
|
|
* |
|
64
|
|
|
* @return ActionInterface |
|
65
|
|
|
*/ |
|
66
|
|
|
public function getInfo($productId, $file, $storeView = null, $identifierType = null) |
|
|
|
|
|
|
67
|
|
|
{ |
|
68
|
|
|
return $this->__createAction('catalog_product_attribute_media.info', func_get_args()); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* Allows you to retrieve the list of product images. |
|
73
|
|
|
* |
|
74
|
|
|
* @param string $productId |
|
75
|
|
|
* @param string $storeView |
|
76
|
|
|
* @param string $identifierType |
|
77
|
|
|
* |
|
78
|
|
|
* @return ActionInterface |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getList($productId, $storeView = null, $identifierType = null) |
|
|
|
|
|
|
81
|
|
|
{ |
|
82
|
|
|
return $this->__createAction('catalog_product_attribute_media.list', func_get_args()); |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* Allows you to remove the image from a product. |
|
87
|
|
|
* |
|
88
|
|
|
* @param string $productId |
|
89
|
|
|
* @param string $file |
|
90
|
|
|
* @param string $identifierType |
|
91
|
|
|
* |
|
92
|
|
|
* @return ActionInterface |
|
93
|
|
|
*/ |
|
94
|
|
|
public function remove($productId, $file, $identifierType = null) |
|
|
|
|
|
|
95
|
|
|
{ |
|
96
|
|
|
return $this->__createAction('catalog_product_attribute_media.remove', func_get_args()); |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* Allows you to retrieve product image types including standard image, small_image, thumbnail, etc. |
|
101
|
|
|
* Note that if the product attribute set contains attributes of the Media Image type |
|
102
|
|
|
* (Catalog Input Type for Store Owner > Media Image), it will also be returned in the response. |
|
103
|
|
|
* |
|
104
|
|
|
* @param string $setId |
|
105
|
|
|
* |
|
106
|
|
|
* @return ActionInterface |
|
107
|
|
|
*/ |
|
108
|
|
|
public function getTypes($setId) |
|
|
|
|
|
|
109
|
|
|
{ |
|
110
|
|
|
return $this->__createAction('catalog_product_attribute_media.types', func_get_args()); |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* Allows you to update the product image. |
|
115
|
|
|
* |
|
116
|
|
|
* @param string $productId |
|
117
|
|
|
* @param string $file |
|
118
|
|
|
* @param array $data |
|
119
|
|
|
* @param string $storeView |
|
120
|
|
|
* @param string $identifierType |
|
121
|
|
|
* |
|
122
|
|
|
* @return ActionInterface |
|
123
|
|
|
*/ |
|
124
|
|
|
public function update($productId, $file, $data, $storeView = null, $identifierType = null) |
|
|
|
|
|
|
125
|
|
|
{ |
|
126
|
|
|
return $this->__createAction('catalog_product_attribute_media.update', func_get_args()); |
|
127
|
|
|
} |
|
128
|
|
|
} |
|
129
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.