當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Requirements::getRequirementPackage方法代碼示例

本文整理匯總了PHP中Requirements::getRequirementPackage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Requirements::getRequirementPackage方法的具體用法?PHP Requirements::getRequirementPackage怎麽用?PHP Requirements::getRequirementPackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Requirements的用法示例。


在下文中一共展示了Requirements::getRequirementPackage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateRequirementPackage

 public function updateRequirementPackage($pack)
 {
     if (!$pack || !$pack->game_id || !$pack->requirement_root_package_id) {
         return;
     }
     Module::query("UPDATE requirement_root_packages SET " . "game_id = '" . addslashes($pack->game_id) . "'" . ($pack->name ? ", name = '" . addslashes($pack->name) . "'" : "") . " WHERE requirement_root_package_id = '" . addslashes($pack->requirement_root_package_id) . "'");
     $sql_currentAndPacks = Module::queryArray("SELECT * FROM requirement_and_packages WHERE requirement_root_package_id = '{$pack->requirement_root_package_id}'");
     for ($i = 0; $i < count($sql_currentAndPacks); $i++) {
         $matchingAndPack = null;
         for ($j = 0; $pack->and_packages && $j < count($pack->and_packages); $j++) {
             if ($sql_currentAndPacks[$i]->requirement_and_package_id == $pack->and_packages[$j]->requirement_and_package_id) {
                 $matchingAndPack = $pack->and_packages[$j];
                 //remove from array so I can just add all remaining later
                 array_splice($pack->and_packages, $j, 1);
                 $j--;
             }
         }
         if ($matchingAndPack) {
             $matchingAndPack->requirement_root_package_id = $pack->requirement_root_package_id;
             $matchingAndPack->game_id = $pack->game_id;
             Requirements::updateRequirementAndPackage($matchingAndPack);
         } else {
             Requirements::deleteRequirementAndPackage($sql_currentAndPacks[$i]->requirement_and_package_id);
         }
     }
     for ($i = 0; $pack->and_packages && $i < count($pack->and_packages); $i++) {
         $pack->and_packages[$i]->requirement_root_package_id = $pack->requirement_root_package_id;
         $pack->and_packages[$i]->game_id = $pack->game_id;
         Requirements::createRequirementAndPackage($pack->and_packages[$i]);
     }
     return Requirements::getRequirementPackage($pack->requirement_root_package_id);
 }
開發者ID:kimblemj,項目名稱:server,代碼行數:32,代碼來源:requirements.php


注:本文中的Requirements::getRequirementPackage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。