From c48ed6b543af5df55d2bc0ec5517032ccd9af2d7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 27 Mar 2013 10:41:33 -0700 Subject: [PATCH] Use generic fn for phone delete --- api/v3/Phone.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) 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); } /** -- 2.25.1