示例#1
0
文件: IGtBatch.php 项目: wy0727/getui
 /**
  * @param $message
  * @param $target
  * @return string
  * @throws \InvalidArgumentException
  */
 public function add($message, $target)
 {
     if ($this->seqId >= 5000) {
         throw new \InvalidArgumentException('Can not add over 5000 message once! Please call submit() first.');
     } else {
         ++$this->seqId;
         $innerMsg = new SingleBatchItem();
         $innerMsg->setSeqId($this->seqId);
         $innerMsg->setData($this->createSingleJson($message, $target));
         $this->innerMsgList[] = $innerMsg;
     }
     return $this->seqId . '';
 }