|
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 ProductLink |
|
24
|
|
|
* |
|
25
|
|
|
* @package Smalot\Magento\Catalog |
|
26
|
|
|
*/ |
|
27
|
|
|
class ProductLink extends MagentoModuleAbstract |
|
28
|
|
|
{ |
|
29
|
|
|
const TYPE_CROSS_SELL = 'cross-sell'; |
|
30
|
|
|
|
|
31
|
|
|
const TYPE_UP_SELL = 'up-sell'; |
|
32
|
|
|
|
|
33
|
|
|
const TYPE_GROUPED = 'grouped'; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* Allows you to assign a product link (related, cross-sell, up-sell, or grouped) to another product. |
|
37
|
|
|
* |
|
38
|
|
|
* @param string $type |
|
39
|
|
|
* @param string $productId |
|
40
|
|
|
* @param string $linkedProductId |
|
41
|
|
|
* @param array $data |
|
42
|
|
|
* @param string $identifierType |
|
43
|
|
|
* |
|
44
|
|
|
* @return ActionInterface |
|
45
|
|
|
*/ |
|
46
|
|
|
public function assign($type, $productId, $linkedProductId, $data, $identifierType = null) |
|
|
|
|
|
|
47
|
|
|
{ |
|
48
|
|
|
return $this->__createAction('catalog_product_link.assign', func_get_args()); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Allows you to retrieve the product link type attributes. |
|
53
|
|
|
* |
|
54
|
|
|
* @param string $type |
|
55
|
|
|
* |
|
56
|
|
|
* @return ActionInterface |
|
57
|
|
|
*/ |
|
58
|
|
|
public function getAttributes($type) |
|
|
|
|
|
|
59
|
|
|
{ |
|
60
|
|
|
return $this->__createAction('catalog_product_link.attributes', func_get_args()); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* Allows you to retrieve the list of linked products for a specific product. |
|
65
|
|
|
* |
|
66
|
|
|
* @param string $type |
|
67
|
|
|
* @param string $productId |
|
68
|
|
|
* @param string $identifierType |
|
69
|
|
|
* |
|
70
|
|
|
* @return ActionInterface |
|
71
|
|
|
*/ |
|
72
|
|
|
public function getList($type, $productId, $identifierType = null) |
|
|
|
|
|
|
73
|
|
|
{ |
|
74
|
|
|
return $this->__createAction('catalog_product_link.list', func_get_args()); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Allows you to remove the product link from a specific product. |
|
79
|
|
|
* |
|
80
|
|
|
* @param string $type |
|
81
|
|
|
* @param string $productId |
|
82
|
|
|
* @param string $linkedProductId |
|
83
|
|
|
* @param string $identifierType |
|
84
|
|
|
* |
|
85
|
|
|
* @return ActionInterface |
|
86
|
|
|
*/ |
|
87
|
|
|
public function remove($type, $productId, $linkedProductId, $identifierType = null) |
|
|
|
|
|
|
88
|
|
|
{ |
|
89
|
|
|
return $this->__createAction('catalog_product_link.remove', func_get_args()); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* Allows you to retrieve the list of product link types. |
|
94
|
|
|
* |
|
95
|
|
|
* @return ActionInterface |
|
96
|
|
|
*/ |
|
97
|
|
|
public function getTypes() |
|
98
|
|
|
{ |
|
99
|
|
|
return $this->__createAction('catalog_product_link.types', func_get_args()); |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* Allows you to update the product link. |
|
104
|
|
|
* |
|
105
|
|
|
* @param string $type |
|
106
|
|
|
* @param string $productId |
|
107
|
|
|
* @param string $linkedProductId |
|
108
|
|
|
* @param array $data |
|
109
|
|
|
* @param string $identifierType |
|
110
|
|
|
* |
|
111
|
|
|
* @return ActionInterface |
|
112
|
|
|
*/ |
|
113
|
|
|
public function update($type, $productId, $linkedProductId, $data, $identifierType = null) |
|
|
|
|
|
|
114
|
|
|
{ |
|
115
|
|
|
return $this->__createAction('catalog_product_link.update', func_get_args()); |
|
116
|
|
|
} |
|
117
|
|
|
} |
|
118
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.