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 ProductDownloadableLink |
24
|
|
|
* |
25
|
|
|
* @package Smalot\Magento\Catalog |
26
|
|
|
*/ |
27
|
|
|
class ProductDownloadableLink extends MagentoModuleAbstract |
28
|
|
|
{ |
29
|
|
|
const TYPE_SAMPLE = 'sample'; |
30
|
|
|
|
31
|
|
|
const TYPE_LINK = 'link'; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Allows you to add a new link to a downloadable product. |
35
|
|
|
* |
36
|
|
|
* @param string $productId |
37
|
|
|
* @param array $resource |
38
|
|
|
* @param string $resourceType |
39
|
|
|
* @param string $store |
40
|
|
|
* @param string $identifierType |
41
|
|
|
* |
42
|
|
|
* @return ActionInterface |
43
|
|
|
*/ |
44
|
|
|
public function add($productId, $resource, $resourceType, $store = null, $identifierType = null) |
|
|
|
|
45
|
|
|
{ |
46
|
|
|
return $this->__createAction('product_downloadable_link.add', func_get_args()); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Allows you to retrieve a list of links of a downloadable product. |
51
|
|
|
* |
52
|
|
|
* @param string $productId |
53
|
|
|
* @param string $store |
54
|
|
|
* @param string $identifierType |
55
|
|
|
* |
56
|
|
|
* @return ActionInterface |
57
|
|
|
*/ |
58
|
|
|
public function getList($productId, $store = null, $identifierType = null) |
|
|
|
|
59
|
|
|
{ |
60
|
|
|
return $this->__createAction('product_downloadable_link.list', func_get_args()); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Allows you to remove a link/sample from a downloadable product. |
65
|
|
|
* |
66
|
|
|
* @param string $linkId |
67
|
|
|
* @param string $resourceType |
68
|
|
|
* |
69
|
|
|
* @return ActionInterface |
70
|
|
|
*/ |
71
|
|
|
public function remove($linkId, $resourceType) |
|
|
|
|
72
|
|
|
{ |
73
|
|
|
return $this->__createAction('product_downloadable_link.remove', func_get_args()); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.