예제 #1
0
파일: Types.php 프로젝트: srspnda/api-php
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('ReportResponse');
     if ($this->commands !== null) {
         if (!is_array($this->commands)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('commands', TType::LST, 1);
         $output->writeListBegin(TType::STRUCT, count($this->commands));
         foreach ($this->commands as $iter55) {
             $xfer += $iter55->write($output);
         }
         $output->writeListEnd();
         $xfer += $output->writeFieldEnd();
     }
     if ($this->timing !== null) {
         if (!is_object($this->timing)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('timing', TType::STRUCT, 2);
         $xfer += $this->timing->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }