function deleteUserRoles() { global $db, $id; $approleDAO = new ApproleDAO($db); if ($role = $approleDAO->load($id)) { $appuserroleDAO = new AppuserroleDAO($db); foreach ($appuserroleDAO->findByRole_name($role->role_name) as $permrow) { $appuserroleDAO->delete($permrow->id); } } }
function deleteRoles() { global $db, $id; $appuserroleDAO = new AppuserroleDAO($db); foreach ($appuserroleDAO->findByUser_id($id) as $rolerow) { $appuserroleDAO->delete($rolerow->id); } }