ItemQuantityUpdateRequest.php
2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/**
* TOP API: taobao.item.quantity.update request
*
* @author auto create
* @since 1.0, 2012-12-13 16:33:03
*/
class ItemQuantityUpdateRequest
{
/**
* 商品数字ID,必填参数
**/
private $numIid;
/**
* SKU的商家编码,可选参数。如果不填则默认修改宝贝的库存,如果填了则按照商家编码搜索出对应的SKU并修改库存。当sku_id和本字段都填写时以sku_id为准搜索对应SKU
**/
private $outerId;
/**
* 库存修改值,必选。当全量更新库存时,quantity必须为大于等于0的正整数;当增量更新库存时,quantity为整数,可小于等于0。若增量更新时传入的库存为负数且绝对值大于当前实际库存,则库存改为0。比如当前实际库存为1,传入增量更新quantity=-5,库存改为0
**/
private $quantity;
/**
* 要操作的SKU的数字ID,可选。如果不填默认修改宝贝的库存,如果填上则修改该SKU的库存
**/
private $skuId;
/**
* 库存更新方式,可选。1为全量更新,2为增量更新。如果不填,默认为全量更新
**/
private $type;
private $apiParas = array();
public function setNumIid($numIid)
{
$this->numIid = $numIid;
$this->apiParas["num_iid"] = $numIid;
}
public function getNumIid()
{
return $this->numIid;
}
public function setOuterId($outerId)
{
$this->outerId = $outerId;
$this->apiParas["outer_id"] = $outerId;
}
public function getOuterId()
{
return $this->outerId;
}
public function setQuantity($quantity)
{
$this->quantity = $quantity;
$this->apiParas["quantity"] = $quantity;
}
public function getQuantity()
{
return $this->quantity;
}
public function setSkuId($skuId)
{
$this->skuId = $skuId;
$this->apiParas["sku_id"] = $skuId;
}
public function getSkuId()
{
return $this->skuId;
}
public function setType($type)
{
$this->type = $type;
$this->apiParas["type"] = $type;
}
public function getType()
{
return $this->type;
}
public function getApiMethodName()
{
return "taobao.item.quantity.update";
}
public function getApiParas()
{
return $this->apiParas;
}
public function check()
{
RequestCheckUtil::checkNotNull($this->numIid,"numIid");
RequestCheckUtil::checkNotNull($this->quantity,"quantity");
}
public function putOtherTextParam($key, $value) {
$this->apiParas[$key] = $value;
$this->$key = $value;
}
}