1. Take any weapon and several magazines for it.
2. Reload it and run
player addMagazine [(primaryWeaponMagazine player) select 0, 0];
in debug window.
3. Check magazines count with
hint str (magazinesAmmo player);
Magazines with zero ammo count will be ignored.
Check ammo with
hint str(soldiermagazines player);
You will see magazines with zero ammo count.
So you cannot check if unit has any empty magazines and cannot get classnames.