Automatically exclude deleted groups from point/level/group integration

This commit is contained in:
Kijin Sung 2016-07-22 16:11:25 +09:00
parent bb037427ae
commit 48e4746f7d
2 changed files with 23 additions and 0 deletions

View file

@ -60,6 +60,25 @@ class pointController extends point
return new Object();
}
/**
* @brief Member group deletion trigger
*/
function triggerDeleteGroup(&$obj)
{
// Get the point module config
$config = getModel('module')->getModuleConfig('point');
// Get the group_srl of the deleted group
$group_srl = $obj->group_srl;
// Exclude deleted group from point/level/group integration
if($config->point_group && isset($config->point_group[$group_srl]))
{
unset($config->point_group[$group_srl]);
getController('module')->insertModuleConfig('point', $config);
}
return new Object();
}
/**
* @brief A trigger to add points to the member for creating a post
*/