id = $params['id']; $values->find(TRUE); $result = CRM_Core_BAO_CustomGroup::deleteGroup($values, TRUE); return $result ? civicrm_api3_create_success() : civicrm_api3_create_error('Error while deleting custom group'); } /** * API to get existing custom fields. * * @param array $params * Array per getfields metadata. * * @return array */ function civicrm_api3_custom_group_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } /** * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom group. * * @param array $params * Array per getfields metadata. * * @return array */ function civicrm_api3_custom_group_setvalue($params) { require_once 'api/v3/Generic/Setvalue.php'; $result = civicrm_api3_generic_setValue(["entity" => 'CustomGroup', 'params' => $params]); if (empty($result['is_error'])) { CRM_Utils_System::flushCache(); } return $result; }