Dependence of polar hole density on magnetic and solar conditions