Exemple #1
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('GetFullMessageResponse');
     if ($this->fullMessage !== null) {
         if (!is_object($this->fullMessage)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('fullMessage', TType::STRUCT, 1);
         $xfer += $this->fullMessage->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
Exemple #2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('ApplicationSentMessage');
     if ($this->messageId !== null) {
         $xfer += $output->writeFieldBegin('messageId', TType::STRING, 1);
         $xfer += $output->writeString($this->messageId);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->messageSentByApplication !== null) {
         if (!is_object($this->messageSentByApplication)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('messageSentByApplication', TType::STRUCT, 2);
         $xfer += $this->messageSentByApplication->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->message !== null) {
         $xfer += $output->writeFieldBegin('message', TType::STRING, 3);
         $xfer += $output->writeString($this->message);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }