It shall be the duty of all police officers of the city in all cases where they know . that State laws are being violated in the city, to apply to the nearest magistrate for a warrant for such person and have the same executed.