public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 1: if ($ftype == TType::I32) { $xfer += $input->readI32($this->errorCode); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::STRUCT) { $this->struct_thing = new \ThriftTest\Xtruct(); $xfer += $this->struct_thing->read($input); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; }
public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 0: if ($ftype == TType::STRUCT) { $this->success = new \ThriftTest\Xtruct(); $xfer += $this->success->read($input); } else { $xfer += $input->skip($ftype); } break; case 1: if ($ftype == TType::STRUCT) { $this->err1 = new \ThriftTest\Xception(); $xfer += $this->err1->read($input); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::STRUCT) { $this->err2 = new \ThriftTest\Xception2(); $xfer += $this->err2->read($input); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; }