X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FPriceSet.php;h=2a1635c636c01b1b91a6a2c76a1e39016a4ad439;hb=b67022d16d25106799f57d39e9301b3f00af619c;hp=6916b13e5c1a2380040e1c50f209c371e8c152af;hpb=8d33e12be1cfc6226cada7978de1306924fb6040;p=civicrm-core.git diff --git a/api/v3/PriceSet.php b/api/v3/PriceSet.php index 6916b13e5c..2a1635c636 100644 --- a/api/v3/PriceSet.php +++ b/api/v3/PriceSet.php @@ -2,9 +2,9 @@ /* /* +--------------------------------------------------------------------+ - | CiviCRM version 4.3 | + | CiviCRM version 4.5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2013 | + | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -57,7 +57,7 @@ function civicrm_api3_price_set_create($params) { foreach ($entityId as $eid) { $eid = (int) trim($eid); if ($eid) { - CRM_Price_BAO_Set::addTo($params['entity_table'], $eid, $result['id']); + CRM_Price_BAO_PriceSet::addTo($params['entity_table'], $eid, $result['id']); } } } @@ -84,10 +84,15 @@ function _civicrm_api3_price_set_create_spec(&$params) { * @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) { - $item['entity'] = CRM_Price_BAO_Set::getUsedBy($item['id'], 'entity'); + $item['entity'] = CRM_Price_BAO_PriceSet::getUsedBy($item['id'], 'entity'); } return civicrm_api3_create_success($result, $params); }