Spin–cavity interactions between a quantum dot molecule and a photonic crystal cavity