implement copying a complete Seminary (implements issue #7)

This commit is contained in:
coderkun 2015-03-21 15:15:49 +01:00
commit b2d00bc624
31 changed files with 2151 additions and 157 deletions

View file

@ -23,6 +23,30 @@
/**
* Copy a Quest
*
* @param int $userId ID of creating user
* @param int $sourceQuestId ID of Quest to copy from
* @param int $targetQuestId ID of Quest to copy to
* @param int $seminaryMediaIds Mapping of SeminaryMedia-IDs from source Seminary to targetSeminary
*/
public function copyQuest($userId, $sourceQuestId, $targetQuestId, $seminaryMediaIds)
{
// Copy words
$this->db->query(
'INSERT INTO questtypes_crossword_words '.
'(quest_id, question, word, vertical, pos_x, pos_y) '.
'SELECT ?, question, word, vertical, pos_x, pos_y '.
'FROM questtypes_crossword_words '.
'WHERE quest_id = ?',
'ii',
$targetQuestId,
$sourceQuestId
);
}
/**
* Get all words for a crossword-Quest.
*