* @example EntityTagCreate.php
*/
function civicrm_api3_entity_tag_create($params) {
-
-
return _civicrm_api3_entity_tag_common($params, 'add');
}
* @access public
*/
function civicrm_api3_membership_delete($params) {
-
- // membershipID should be numeric
- // this check should be done @ wrapper level
- if (!is_numeric($params['id'])) {
- return civicrm_api3_create_error('Input parameter should be numeric');
- }
-
- $membership = new CRM_Member_BAO_Membership();
- $result = $membership->del($params['id']);
-
- return $result ? civicrm_api3_create_success() : civicrm_api3_create_error('Error while deleting Membership');
-
+ return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* @param array $params array or parameters determined by getfields
*/
function _civicrm_api3_price_field_value_create_spec(&$params) {
+ $params['price_field_id']['api.required'] = TRUE;
}
/**
* @access public
*/
function civicrm_api3_price_set_get($params) {
+ // hack to make getcount work. - not sure the best approach here
+ // as creating an alternate getcount function also feels a bit hacky
+ if(isset($params['options']) && isset($params['options']['is_count'])) {
+ return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+ }
$result = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE);
// Fetch associated entities
foreach ($result as &$item) {