No Description

BatchSendFailException.php 956B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace AliyunMNS\Exception;
  3. use AliyunMNS\Constants;
  4. use AliyunMNS\Exception\MnsException;
  5. use AliyunMNS\Model\SendMessageResponseItem;
  6. /**
  7. * BatchSend could fail for some messages,
  8. * and BatchSendFailException will be thrown.
  9. * Results for messages are saved in "$sendMessageResponseItems"
  10. */
  11. class BatchSendFailException extends MnsException
  12. {
  13. protected $sendMessageResponseItems;
  14. public function __construct($code, $message, $previousException = NULL, $requestId = NULL, $hostId = NULL)
  15. {
  16. parent::__construct($code, $message, $previousException, Constants::BATCH_SEND_FAIL, $requestId, $hostId);
  17. $this->sendMessageResponseItems = array();
  18. }
  19. public function addSendMessageResponseItem(SendMessageResponseItem $item)
  20. {
  21. $this->sendMessageResponseItems[] = $item;
  22. }
  23. public function getSendMessageResponseItems()
  24. {
  25. return $this->sendMessageResponseItems;
  26. }
  27. }
  28. ?>