コード例 #1
0
ファイル: Types.php プロジェクト: ychadwick/p13n-client-php
 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::STRUCT) {
                     $this->userRecord = new \com\boxalino\p13n\api\thrift\UserRecord();
                     $xfer += $this->userRecord->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 21:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->scope);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 31:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->choiceId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 41:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->profileId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 51:
                 if ($ftype == TType::STRUCT) {
                     $this->requestContext = new \com\boxalino\p13n\api\thrift\RequestContext();
                     $xfer += $this->requestContext->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 61:
                 if ($ftype == TType::SET) {
                     $this->excludeVariantIds = array();
                     $_size208 = 0;
                     $_etype211 = 0;
                     $xfer += $input->readSetBegin($_etype211, $_size208);
                     for ($_i212 = 0; $_i212 < $_size208; ++$_i212) {
                         $elem213 = null;
                         $xfer += $input->readString($elem213);
                         if (is_scalar($elem213)) {
                             $this->excludeVariantIds[$elem213] = true;
                         } else {
                             $this->excludeVariantIds[] = $elem213;
                         }
                     }
                     $xfer += $input->readSetEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 71:
                 if ($ftype == TType::STRUCT) {
                     $this->autocompleteQuery = new \com\boxalino\p13n\api\thrift\AutocompleteQuery();
                     $xfer += $this->autocompleteQuery->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 81:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->searchChoiceId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 91:
                 if ($ftype == TType::STRUCT) {
                     $this->searchQuery = new \com\boxalino\p13n\api\thrift\SimpleSearchQuery();
                     $xfer += $this->searchQuery->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }
コード例 #2
0
ファイル: Types.php プロジェクト: boxalino/plugin-shopware
 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::STRUCT) {
                     $this->userRecord = new \com\boxalino\p13n\api\thrift\UserRecord();
                     $xfer += $this->userRecord->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 21:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->scope);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 31:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->choiceId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 41:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->profileId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 51:
                 if ($ftype == TType::STRUCT) {
                     $this->requestContext = new \com\boxalino\p13n\api\thrift\RequestContext();
                     $xfer += $this->requestContext->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 61:
                 if ($ftype == TType::SET) {
                     $this->excludeVariantIds = array();
                     $_size223 = 0;
                     $_etype226 = 0;
                     $xfer += $input->readSetBegin($_etype226, $_size223);
                     for ($_i227 = 0; $_i227 < $_size223; ++$_i227) {
                         $elem228 = null;
                         $xfer += $input->readString($elem228);
                         if (is_scalar($elem228)) {
                             $this->excludeVariantIds[$elem228] = true;
                         } else {
                             $this->excludeVariantIds[] = $elem228;
                         }
                     }
                     $xfer += $input->readSetEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 71:
                 if ($ftype == TType::STRUCT) {
                     $this->autocompleteQuery = new \com\boxalino\p13n\api\thrift\AutocompleteQuery();
                     $xfer += $this->autocompleteQuery->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 81:
                 if ($ftype == TType::STRING) {
                     $xfer += $input->readString($this->searchChoiceId);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 91:
                 if ($ftype == TType::STRUCT) {
                     $this->searchQuery = new \com\boxalino\p13n\api\thrift\SimpleSearchQuery();
                     $xfer += $this->searchQuery->read($input);
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 101:
                 if ($ftype == TType::SET) {
                     $this->includeVariantIds = array();
                     $_size229 = 0;
                     $_etype232 = 0;
                     $xfer += $input->readSetBegin($_etype232, $_size229);
                     for ($_i233 = 0; $_i233 < $_size229; ++$_i233) {
                         $elem234 = null;
                         $xfer += $input->readString($elem234);
                         if (is_scalar($elem234)) {
                             $this->includeVariantIds[$elem234] = true;
                         } else {
                             $this->includeVariantIds[] = $elem234;
                         }
                     }
                     $xfer += $input->readSetEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             case 110:
                 if ($ftype == TType::LST) {
                     $this->propertyQueries = array();
                     $_size235 = 0;
                     $_etype238 = 0;
                     $xfer += $input->readListBegin($_etype238, $_size235);
                     for ($_i239 = 0; $_i239 < $_size235; ++$_i239) {
                         $elem240 = null;
                         $elem240 = new \com\boxalino\p13n\api\thrift\PropertyQuery();
                         $xfer += $elem240->read($input);
                         $this->propertyQueries[] = $elem240;
                     }
                     $xfer += $input->readListEnd();
                 } else {
                     $xfer += $input->skip($ftype);
                 }
                 break;
             default:
                 $xfer += $input->skip($ftype);
                 break;
         }
         $xfer += $input->readFieldEnd();
     }
     $xfer += $input->readStructEnd();
     return $xfer;
 }