implement clean deletion of Seminaries
This commit is contained in:
parent
4dca3e8089
commit
60b7f12f79
25 changed files with 410 additions and 9 deletions
|
|
@ -749,6 +749,28 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete all Questgroups of a Seminary.
|
||||
*
|
||||
* @param int $seminaryId ID of Seminary to delete Questgroups of
|
||||
*/
|
||||
public function deleteQuestgroupsOfSeminary($seminaryId)
|
||||
{
|
||||
// Get Questgroups
|
||||
$questgroups = $this->getQuestgroupsForSeminary($seminaryId);
|
||||
|
||||
// Delete each Questgroup
|
||||
foreach($questgroups as &$questgroup)
|
||||
{
|
||||
// Delete Questgroup texts
|
||||
$this->Questgrouptexts->deleteQuestgrouptexts($questgroup['id']);
|
||||
|
||||
// Delete Questgroup
|
||||
$this->db->query('DELETE FROM questgroups WHERE id = ?', 'i', $questgroup['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue