implement clean deletion of Seminaries
This commit is contained in:
parent
4dca3e8089
commit
60b7f12f79
25 changed files with 410 additions and 9 deletions
|
|
@ -20,6 +20,12 @@
|
|||
*/
|
||||
class CharactergroupsModel extends \hhu\z\Model
|
||||
{
|
||||
/**
|
||||
* Required models
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $models = array('charactergroupsquests');
|
||||
|
||||
|
||||
|
||||
|
|
@ -225,6 +231,31 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete all Character groups-groups of a Seminary.
|
||||
*
|
||||
* @param int $seminaryId ID of Seminary to delete Character groups-groups of
|
||||
*/
|
||||
public function deleteGroupsgroupsOfSeminary($seminaryId)
|
||||
{
|
||||
// Get Groupsgroups
|
||||
$charactergroupsgroups = $this->getGroupsroupsForSeminary($seminaryId);
|
||||
|
||||
// Delete each Groupsgroup
|
||||
foreach($charactergroupsgroups as $groupsgroup)
|
||||
{
|
||||
// Delete Groups
|
||||
$this->deleteGroupsOfGroupsgroup($groupsgroup['id']);
|
||||
|
||||
// Delete Groupsquests
|
||||
$this->Charactergroupsquests->deleteQuestsOfGroupsgroup($groupsgroup['id']);
|
||||
|
||||
// Delete Groupsgroup
|
||||
$this->db->query('DELETE FROM charactergroupsgroups WHERE seminary_id = ?', 'i', $seminaryId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Character groups for a Character groups-group.
|
||||
*
|
||||
|
|
@ -475,6 +506,17 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete all Character groups of a groups-group.
|
||||
*
|
||||
* @param int $groupsgroupId ID of Character groups-group to delete groups of
|
||||
*/
|
||||
public function deleteGroupsOfGroupsgroup($groupsgroupId)
|
||||
{
|
||||
$this->db->query('DELETE FROM charactergroups WHERE charactergroupsgroup_id = ?', 'i', $groupsgroupId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the rank of a XP-value of a Character.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue