CRM-21052 - Activity.create API - Abide by setting `civicaseActivityRevisions`
[civicrm-core.git] / api / v3 / PriceSet.php
index b31ced3848a9fa9ce3659a908cd20d3202391181..b7b15e6019c1b2bfdbe41205dce6a69666613540 100644 (file)
@@ -91,9 +91,11 @@ function civicrm_api3_price_set_get($params) {
     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_PriceSet::getUsedBy($item['id'], 'entity');
+  // Fetch associated entities if the return has not been previously limited.
+  if (!isset($params['return'])) {
+    foreach ($result as &$item) {
+      $item['entity'] = CRM_Price_BAO_PriceSet::getUsedBy($item['id'], 'entity');
+    }
   }
   return civicrm_api3_create_success($result, $params);
 }