当前位置: 首页>>代码示例>>PHP>>正文


PHP Requirements::migrateReqAtom方法代码示例

本文整理汇总了PHP中Requirements::migrateReqAtom方法的典型用法代码示例。如果您正苦于以下问题:PHP Requirements::migrateReqAtom方法的具体用法?PHP Requirements::migrateReqAtom怎么用?PHP Requirements::migrateReqAtom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Requirements的用法示例。


在下文中一共展示了Requirements::migrateReqAtom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: migrateReqPack

 private function migrateReqPack($pack, $gameId)
 {
     Module::query("INSERT INTO requirement_root_packages (game_id, name, created) VALUES ('{$gameId}','', CURRENT_TIMESTAMP)");
     $requirement_root_id = mysql_insert_id();
     for ($i = 0; $i < count($pack->or_reqs); $i++) {
         Module::query("INSERT INTO requirement_and_packages (game_id, requirement_root_package_id, name, created) VALUES ('{$gameId}','{$requirement_root_id}','', CURRENT_TIMESTAMP)");
         $requirement_and_id = mysql_insert_id();
         Requirements::migrateReqAtom($pack->or_reqs[$i], $gameId, $requirement_and_id);
     }
     if (count($pack->and_reqs) > 0) {
         Module::query("INSERT INTO requirement_and_packages (game_id, requirement_root_package_id, name, created) VALUES ('{$gameId}','{$requirement_root_id}','', CURRENT_TIMESTAMP)");
         $requirement_and_id = mysql_insert_id();
         for ($i = 0; $i < count($pack->and_reqs); $i++) {
             Requirements::migrateReqAtom($pack->and_reqs[$i], $gameId, $requirement_and_id);
         }
     }
     switch ($pack->type) {
         case "Node":
             Module::query("UPDATE nodes SET requirement_package_id = '{$requirement_root_id}' WHERE node_id = '{$pack->type_id}'");
             break;
         case "QuestDisplay":
             Module::query("UPDATE quests SET display_requirement_package_id = '{$requirement_root_id}' WHERE quest_id = '{$pack->type_id}'");
             break;
         case "QuestComplete":
             Module::query("UPDATE quests SET complete_requirement_package_id = '{$requirement_root_id}' WHERE quest_id = '{$pack->type_id}'");
             break;
         case "Location":
             Module::query("UPDATE locations SET requirement_package_id = '{$requirement_root_id}' WHERE location_id = '{$pack->type_id}'");
             break;
         case "OutgoingWebHook":
             Module::query("UPDATE web_hooks SET requirement_package_id = '{$requirement_root_id}' WHERE web_hook_id = '{$pack->type_id}'");
             break;
         case "Spawnable":
             Module::query("UPDATE spawnables SET requirement_package_id = '{$requirement_root_id}' WHERE spawnable_id = '{$pack->type_id}'");
             break;
     }
 }
开发者ID:kimblemj,项目名称:server,代码行数:37,代码来源:requirements.php


注:本文中的Requirements::migrateReqAtom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。