ItempropvaluesGetRequest.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. /**
  3. * TOP API: taobao.itempropvalues.get request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2016.09.21
  7. */
  8. class ItempropvaluesGetRequest
  9. {
  10. /**
  11. * 属性的Key,支持多条,以“,”分隔
  12. **/
  13. private $attrKeys;
  14. /**
  15. * 叶子类目ID ,通过taobao.itemcats.get获得叶子类目ID
  16. **/
  17. private $cid;
  18. /**
  19. * 假如传2005-01-01 00:00:00,则取所有的属性和子属性(状态为删除的属性值不返回prop_name)
  20. **/
  21. private $datetime;
  22. /**
  23. * 需要返回的字段。目前支持有:cid,pid,prop_name,vid,name,name_alias,status,sort_order
  24. **/
  25. private $fields;
  26. /**
  27. * 属性和属性值 id串,格式例如(pid1;pid2)或(pid1:vid1;pid2:vid2)或(pid1;pid2:vid2)
  28. **/
  29. private $pvs;
  30. /**
  31. * 获取类目的类型:1代表集市、2代表天猫
  32. **/
  33. private $type;
  34. private $apiParas = array();
  35. public function setAttrKeys($attrKeys)
  36. {
  37. $this->attrKeys = $attrKeys;
  38. $this->apiParas["attr_keys"] = $attrKeys;
  39. }
  40. public function getAttrKeys()
  41. {
  42. return $this->attrKeys;
  43. }
  44. public function setCid($cid)
  45. {
  46. $this->cid = $cid;
  47. $this->apiParas["cid"] = $cid;
  48. }
  49. public function getCid()
  50. {
  51. return $this->cid;
  52. }
  53. public function setDatetime($datetime)
  54. {
  55. $this->datetime = $datetime;
  56. $this->apiParas["datetime"] = $datetime;
  57. }
  58. public function getDatetime()
  59. {
  60. return $this->datetime;
  61. }
  62. public function setFields($fields)
  63. {
  64. $this->fields = $fields;
  65. $this->apiParas["fields"] = $fields;
  66. }
  67. public function getFields()
  68. {
  69. return $this->fields;
  70. }
  71. public function setPvs($pvs)
  72. {
  73. $this->pvs = $pvs;
  74. $this->apiParas["pvs"] = $pvs;
  75. }
  76. public function getPvs()
  77. {
  78. return $this->pvs;
  79. }
  80. public function setType($type)
  81. {
  82. $this->type = $type;
  83. $this->apiParas["type"] = $type;
  84. }
  85. public function getType()
  86. {
  87. return $this->type;
  88. }
  89. public function getApiMethodName()
  90. {
  91. return "taobao.itempropvalues.get";
  92. }
  93. public function getApiParas()
  94. {
  95. return $this->apiParas;
  96. }
  97. public function check()
  98. {
  99. RequestCheckUtil::checkMaxListSize($this->attrKeys,20,"attrKeys");
  100. RequestCheckUtil::checkNotNull($this->cid,"cid");
  101. RequestCheckUtil::checkNotNull($this->fields,"fields");
  102. RequestCheckUtil::checkMaxListSize($this->fields,20,"fields");
  103. RequestCheckUtil::checkMaxValue($this->type,2,"type");
  104. RequestCheckUtil::checkMinValue($this->type,1,"type");
  105. }
  106. public function putOtherTextParam($key, $value) {
  107. $this->apiParas[$key] = $value;
  108. $this->$key = $value;
  109. }
  110. }