Aharonov–Bohm ring with a side-coupled quantum dot array as a spin switch