本文整理汇总了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;
}
}