implement copying of Stations for Seminary copy feature

This commit is contained in:
oliver 2016-01-30 20:15:13 +01:00
commit 84a3855e47
8 changed files with 166 additions and 25 deletions

View file

@ -23,6 +23,30 @@
/**
* Copy a Station.
*
* @param int $userId ID of creating user
* @param int $sourceStationId ID of Station to copy from
* @param int $targetStationId ID of Station to copy to
* @param int $seminaryMediaIds Mapping of SeminaryMedia-IDs from source Seminary to targetSeminary
*/
public function copyStation($userId, $sourceStationId, $targetStationId, $seminaryMediaIds)
{
// Copy keyword
$this->db->query(
'INSERT INTO stationtypes_keyword '.
'(station_id, created_user_id, keyword_regex) '.
'SELECT ?, ?, keyword_regex '.
'FROM stationtypes_keyword '.
'WHERE station_id = ?',
'iii',
$targetStationId, $userId,
$sourceStationId
);
}
/**
* Get the task of a keyword Station
*