From: Coleman Watts Date: Wed, 27 Mar 2013 17:41:33 +0000 (-0700) Subject: Use generic fn for phone delete X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c48ed6b543af5df55d2bc0ec5517032ccd9af2d7;p=civicrm-core.git Use generic fn for phone delete --- diff --git a/api/v3/Phone.php b/api/v3/Phone.php index d32561080a..8ed7c3213d 100644 --- a/api/v3/Phone.php +++ b/api/v3/Phone.php @@ -80,21 +80,7 @@ function _civicrm_api3_phone_create_spec(&$params) { * @access public */ function civicrm_api3_phone_delete($params) { - - $phoneID = CRM_Utils_Array::value('id', $params); - - require_once 'CRM/Core/DAO/Phone.php'; - $phoneDAO = new CRM_Core_DAO_Phone(); - $phoneDAO->id = $phoneID; - if ($phoneDAO->find()) { - while ($phoneDAO->fetch()) { - $phoneDAO->delete(); - return civicrm_api3_create_success($phoneDAO->id, $params, $phoneDAO); - } - } - else { - return civicrm_api3_create_error('Could not delete phone with id ' . $phoneID); - } + return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); } /**