/** * Return personal fax phone for this contact. * * @access public * @param void * @return ContactTelephone * @author Seba */ function getPhone($type, $is_main = false, $check_is_main = true) { if ($check_is_main) { $is_main_cond = "`is_main` = " . ($is_main ? 1 : 0); } else { $is_main_cond = "true"; } $telephone_type_id = TelephoneTypes::getTelephoneTypeId($type); return ContactTelephones::findOne(array('conditions' => array("{$is_main_cond} AND `contact_id` = ? AND \r\n\t\t`telephone_type_id` = ?", $this->getId(), $telephone_type_id))); }
/** * Return personal fax phone for this contact. * * @access public * @param void * @return ContactTelephone * @author Seba */ function getPhone($type, $is_main = false) { $is_main ? $is_main = 1 : ($is_main = 0); $telephone_type_id = TelephoneTypes::getTelephoneTypeId($type); return ContactTelephones::findOne(array('conditions' => array("`is_main` = {$is_main} AND `contact_id` = ? AND \n\t\t`telephone_type_id` = ?", $this->getId(), $telephone_type_id))); }