GTPushBatchRequest.php 957 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. require_once(dirname(__FILE__) . '/' . 'GTPushRequest.php');
  3. class GTPushBatchRequest extends GTApiRequest {
  4. private $isAsync;
  5. private $msgList = array();
  6. public function getIsAsync()
  7. {
  8. return $this->isAsync;
  9. }
  10. public function setIsAsync($isAsync)
  11. {
  12. $this->isAsync = $isAsync;
  13. $this->apiParam["is_async"] = $isAsync;
  14. }
  15. public function getMsgList()
  16. {
  17. return $this->msgList;
  18. }
  19. public function addMsgList($msg)
  20. {
  21. array_push($this->msgList, $msg);
  22. }
  23. public function setMsgList($msg)
  24. {
  25. $this->msgList = $msg;
  26. }
  27. public function getApiParam()
  28. {
  29. if (!empty($this->msgList)){
  30. $this->apiParam["msg_list"] = array();
  31. foreach ($this->msgList as $value) {
  32. array_push($this->apiParam["msg_list"], $value->getApiParam());
  33. }
  34. }
  35. return $this->apiParam;
  36. }
  37. }