public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('BeeswaxService_close_args'); if ($this->handle !== null) { if (!is_object($this->handle)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('handle', TType::STRUCT, 1); $xfer += $this->handle->write($output); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; }
public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('BeeswaxException'); if ($this->message !== null) { $xfer += $output->writeFieldBegin('message', TType::STRING, 1); $xfer += $output->writeString($this->message); $xfer += $output->writeFieldEnd(); } if ($this->log_context !== null) { $xfer += $output->writeFieldBegin('log_context', TType::STRING, 2); $xfer += $output->writeString($this->log_context); $xfer += $output->writeFieldEnd(); } if ($this->handle !== null) { if (!is_object($this->handle)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('handle', TType::STRUCT, 3); $xfer += $this->handle->write($output); $xfer += $output->writeFieldEnd(); } if ($this->errorCode !== null) { $xfer += $output->writeFieldBegin('errorCode', TType::I32, 4); $xfer += $output->writeI32($this->errorCode); $xfer += $output->writeFieldEnd(); } if ($this->SQLState !== null) { $xfer += $output->writeFieldBegin('SQLState', TType::STRING, 5); $xfer += $output->writeString($this->SQLState); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; }