コード例 #1
0
ファイル: Types.php プロジェクト: RedRoma/aroma-thrift
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('EmailNewApplication');
     if ($this->creator !== null) {
         if (!is_object($this->creator)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('creator', TType::STRUCT, 1);
         $xfer += $this->creator->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->app !== null) {
         if (!is_object($this->app)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('app', TType::STRUCT, 2);
         $xfer += $this->app->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->appToken !== null) {
         if (!is_object($this->appToken)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('appToken', TType::STRUCT, 3);
         $xfer += $this->appToken->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
コード例 #2
0
ファイル: Types.php プロジェクト: RedRoma/aroma-thrift
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('GetApplicationInfoResponse');
     if ($this->applicationInfo !== null) {
         if (!is_object($this->applicationInfo)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('applicationInfo', TType::STRUCT, 1);
         $xfer += $this->applicationInfo->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->registeredChannels !== null) {
         if (!is_array($this->registeredChannels)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('registeredChannels', TType::LST, 2);
         $output->writeListBegin(TType::STRUCT, count($this->registeredChannels));
         foreach ($this->registeredChannels as $iter49) {
             $xfer += $iter49->write($output);
         }
         $output->writeListEnd();
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
コード例 #3
0
ファイル: Types.php プロジェクト: RedRoma/aroma-thrift
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('Event');
     if ($this->eventId !== null) {
         $xfer += $output->writeFieldBegin('eventId', TType::STRING, 1);
         $xfer += $output->writeString($this->eventId);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->userIdOfActor !== null) {
         $xfer += $output->writeFieldBegin('userIdOfActor', TType::STRING, 2);
         $xfer += $output->writeString($this->userIdOfActor);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->actor !== null) {
         if (!is_object($this->actor)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('actor', TType::STRUCT, 3);
         $xfer += $this->actor->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->applicationId !== null) {
         $xfer += $output->writeFieldBegin('applicationId', TType::STRING, 4);
         $xfer += $output->writeString($this->applicationId);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->application !== null) {
         if (!is_object($this->application)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('application', TType::STRUCT, 5);
         $xfer += $this->application->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->eventType !== null) {
         if (!is_object($this->eventType)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('eventType', TType::STRUCT, 6);
         $xfer += $this->eventType->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->timestamp !== null) {
         $xfer += $output->writeFieldBegin('timestamp', TType::I64, 7);
         $xfer += $output->writeI64($this->timestamp);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }