Esempio 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::LST) {
                     $this->hits = array();
                     $_size124 = 0;
                     $_etype127 = 0;
                     $xfer += $input->readListBegin($_etype127, $_size124);
                     for ($_i128 = 0; $_i128 < $_size124; ++$_i128) {
                         $elem129 = null;
                         $elem129 = new \com\boxalino\p13n\api\thrift\Hit();
                         $xfer += $elem129->read($input);
                         $this->hits[] = $elem129;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::LST) {
                     $this->facetResponses = array();
                     $_size130 = 0;
                     $_etype133 = 0;
                     $xfer += $input->readListBegin($_etype133, $_size130);
                     for ($_i134 = 0; $_i134 < $_size130; ++$_i134) {
                         $elem135 = null;
                         $elem135 = new \com\boxalino\p13n\api\thrift\FacetResponse();
                         $xfer += $elem135->read($input);
                         $this->facetResponses[] = $elem135;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->totalHitCount);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 40:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->queryText);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 50:
                 if ($ftype == TType::LST) {
                     $this->hitsGroups = array();
                     $_size136 = 0;
                     $_etype139 = 0;
                     $xfer += $input->readListBegin($_etype139, $_size136);
                     for ($_i140 = 0; $_i140 < $_size136; ++$_i140) {
                         $elem141 = null;
                         $elem141 = new \com\boxalino\p13n\api\thrift\HitsGroup();
                         $xfer += $elem141->read($input);
                         $this->hitsGroups[] = $elem141;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
Esempio 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::LST) {
                     $this->hits = array();
                     $_size132 = 0;
                     $_etype135 = 0;
                     $xfer += $input->readListBegin($_etype135, $_size132);
                     for ($_i136 = 0; $_i136 < $_size132; ++$_i136) {
                         $elem137 = null;
                         $elem137 = new \com\boxalino\p13n\api\thrift\Hit();
                         $xfer += $elem137->read($input);
                         $this->hits[] = $elem137;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 2:
                 if ($ftype == TType::LST) {
                     $this->facetResponses = array();
                     $_size138 = 0;
                     $_etype141 = 0;
                     $xfer += $input->readListBegin($_etype141, $_size138);
                     for ($_i142 = 0; $_i142 < $_size138; ++$_i142) {
                         $elem143 = null;
                         $elem143 = new \com\boxalino\p13n\api\thrift\FacetResponse();
                         $xfer += $elem143->read($input);
                         $this->facetResponses[] = $elem143;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 3:
                 if ($ftype == TType::I64) {
                     $xfer += $input->readI64($this->totalHitCount);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 40:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->queryText);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 50:
                 if ($ftype == TType::LST) {
                     $this->hitsGroups = array();
                     $_size144 = 0;
                     $_etype147 = 0;
                     $xfer += $input->readListBegin($_etype147, $_size144);
                     for ($_i148 = 0; $_i148 < $_size144; ++$_i148) {
                         $elem149 = null;
                         $elem149 = new \com\boxalino\p13n\api\thrift\HitsGroup();
                         $xfer += $elem149->read($input);
                         $this->hitsGroups[] = $elem149;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }