Four men received prison sentences when they appeared before York Magistrates Court recently.