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 11:
                 if ($ftype == TType::LST) {
                     $this->hits = array();
                     $_size216 = 0;
                     $_etype219 = 0;
                     $xfer += $input->readListBegin($_etype219, $_size216);
                     for ($_i220 = 0; $_i220 < $_size216; ++$_i220) {
                         $elem221 = null;
                         $elem221 = new \com\boxalino\p13n\api\thrift\AutocompleteHit();
                         $xfer += $elem221->read($input);
                         $this->hits[] = $elem221;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 21:
                 if ($ftype == TType::STRUCT) {
                     $this->prefixSearchResult = new \com\boxalino\p13n\api\thrift\SearchResult();
                     $xfer += $this->prefixSearchResult->read($input);
                 } 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 11:
                 if ($ftype == TType::LST) {
                     $this->hits = array();
                     $_size253 = 0;
                     $_etype256 = 0;
                     $xfer += $input->readListBegin($_etype256, $_size253);
                     for ($_i257 = 0; $_i257 < $_size253; ++$_i257) {
                         $elem258 = null;
                         $elem258 = new \com\boxalino\p13n\api\thrift\AutocompleteHit();
                         $xfer += $elem258->read($input);
                         $this->hits[] = $elem258;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 21:
                 if ($ftype == TType::STRUCT) {
                     $this->prefixSearchResult = new \com\boxalino\p13n\api\thrift\SearchResult();
                     $xfer += $this->prefixSearchResult->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 31:
                 if ($ftype == TType::LST) {
                     $this->propertyResults = array();
                     $_size259 = 0;
                     $_etype262 = 0;
                     $xfer += $input->readListBegin($_etype262, $_size259);
                     for ($_i263 = 0; $_i263 < $_size259; ++$_i263) {
                         $elem264 = null;
                         $elem264 = new \com\boxalino\p13n\api\thrift\PropertyResult();
                         $xfer += $elem264->read($input);
                         $this->propertyResults[] = $elem264;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }