X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FWebsite.php;h=98e74e5cf2f5cd59607a2b433be3dfeaa1175025;hb=293d50b4211dcd40bd421da0047f7fb4833fdcbf;hp=d087858045fb6512022ece81aeda31c7f9aecb4b;hpb=c4f10bdde8763c3b8a2861d71dab6cfe29580932;p=civicrm-core.git diff --git a/api/v3/Website.php b/api/v3/Website.php index d087858045..98e74e5cf2 100644 --- a/api/v3/Website.php +++ b/api/v3/Website.php @@ -1,7 +1,7 @@ id]); - return civicrm_api3_create_success($values, $params, 'Website', 'get'); + return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Website'); } /** @@ -64,8 +58,6 @@ function _civicrm_api3_website_create_spec(&$params) { /** * Deletes an existing Website. * - * @todo convert to using Basic delete - BAO function non standard - * * @param array $params * * @return array @@ -73,20 +65,7 @@ function _civicrm_api3_website_create_spec(&$params) { * @throws \API_Exception */ function civicrm_api3_website_delete($params) { - //DO NOT USE THIS FUNCTION AS THE BASIS FOR A NEW API http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards - civicrm_api3_verify_mandatory($params, NULL, array('id')); - _civicrm_api3_check_edit_permissions('CRM_Core_BAO_Website', array('id' => $params['id'])); - $websiteDAO = new CRM_Core_DAO_Website(); - $websiteDAO->id = $params['id']; - if ($websiteDAO->find()) { - while ($websiteDAO->fetch()) { - $websiteDAO->delete(); - return civicrm_api3_create_success(1, $params, 'Website', 'delete'); - } - } - else { - throw new API_Exception('Could not delete Website with id ' . $params['id']); - } + return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); } /**