public function countImpactedFunctions($delivery_id, Doctrine_Connection $conn = null) { $q = " \n select count(distinct(t_id)) from ei_delivery_impacted_functions_vw \n where (s_delivery_id=" . $delivery_id . " or s2_delivery_id=" . $delivery_id . ") \n "; return $conn->fetchOne($q); }