Exemplo n.º 1
0
 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::STRING) {
                     $xfer += $input->readString($this->tableName);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->row);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::LST) {
                     $this->mutations = array();
                     $_size301 = 0;
                     $_etype304 = 0;
                     $xfer += $input->readListBegin($_etype304, $_size301);
                     for ($_i305 = 0; $_i305 < $_size301; ++$_i305) {
                         $elem306 = null;
                         $elem306 = new \Mutation();
                         $xfer += $elem306->read($input);
                         $this->mutations[] = $elem306;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 4:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->timestamp);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 5:
                 if ($ftype == TType::MAP) {
                     $this->attributes = array();
                     $_size307 = 0;
                     $_ktype308 = 0;
                     $_vtype309 = 0;
                     $xfer += $input->readMapBegin($_ktype308, $_vtype309, $_size307);
                     for ($_i311 = 0; $_i311 < $_size307; ++$_i311) {
                         $key312 = '';
                         $val313 = '';
                         $xfer += $input->readString($key312);
                         $xfer += $input->readString($val313);
                         $this->attributes[$key312] = $val313;
                     }
                     $xfer += $input->readMapEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
Exemplo n.º 2
0
 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::STRING) {
                     $xfer += $input->readString($this->row);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::LST) {
                     $this->mutations = array();
                     $_size0 = 0;
                     $_etype3 = 0;
                     $xfer += $input->readListBegin($_etype3, $_size0);
                     for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
                         $elem5 = null;
                         $elem5 = new \Mutation();
                         $xfer += $elem5->read($input);
                         $this->mutations[] = $elem5;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }