* @param array $params
*
* @return array
+ * @throws \CRM_Core_Exception
+ * @noinspection PhpUnused
*/
-function civicrm_api3_event_delete($params) {
- return CRM_Event_BAO_Event::del($params['id']) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while deleting event'));
+function civicrm_api3_event_delete(array $params): array {
+ CRM_Event_BAO_Event::deleteRecord($params);
+ return civicrm_api3_create_success();
}
/**
* This API is used for deleting a membership status
*
* @param array $params
+ *
* @return array
* @throws CRM_Core_Exception
- * @throws CRM_Core_Exception
+ * @noinspection PhpUnused
*/
-function civicrm_api3_membership_status_delete($params) {
-
- $memberStatusDelete = CRM_Member_BAO_MembershipStatus::del($params['id'], TRUE);
- if ($memberStatusDelete) {
- throw new CRM_Core_Exception($memberStatusDelete['error_message']);
- }
+function civicrm_api3_membership_status_delete(array $params): array {
+ CRM_Member_BAO_MembershipStatus::deleteRecord($params);
return civicrm_api3_create_success();
}