예제 #1
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('SnoozeChannelRequest');
     if ($this->token !== null) {
         if (!is_object($this->token)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('token', TType::STRUCT, 1);
         $xfer += $this->token->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->channel !== null) {
         if (!is_object($this->channel)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('channel', TType::STRUCT, 2);
         $xfer += $this->channel->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->applicationId !== null) {
         $xfer += $output->writeFieldBegin('applicationId', TType::STRING, 3);
         $xfer += $output->writeString($this->applicationId);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->lengthOfTime !== null) {
         if (!is_object($this->lengthOfTime)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('lengthOfTime', TType::STRUCT, 4);
         $xfer += $this->lengthOfTime->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
예제 #2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('ChannelInfo');
     if ($this->channel !== null) {
         if (!is_object($this->channel)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('channel', TType::STRUCT, 1);
         $xfer += $this->channel->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->timeRegistered !== null) {
         $xfer += $output->writeFieldBegin('timeRegistered', TType::I64, 2);
         $xfer += $output->writeI64($this->timeRegistered);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->channelId !== null) {
         $xfer += $output->writeFieldBegin('channelId', TType::STRING, 3);
         $xfer += $output->writeString($this->channelId);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }