本文整理匯總了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;
}
}