Skip to content

Commit

Permalink
Remove deprecated ids param
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Sep 5, 2020
1 parent 30bd3f9 commit 87c5b5b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,17 @@ public function __construct() {
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
* @param array $ids
* The array that holds all the db ids.
*
* @return \CRM_Contribute_BAO_Contribution
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public static function add(&$params, $ids = []) {
public static function add(&$params) {
if (empty($params)) {
return NULL;
}
if (!empty($ids)) {
CRM_Core_Error::deprecatedFunctionWarning('ids should not be passed into Contribution.add');
}
//per http://wiki.civicrm.org/confluence/display/CRM/Database+layer we are moving away from $ids array
$contributionID = CRM_Utils_Array::value('contribution', $ids, CRM_Utils_Array::value('id', $params));

$contributionID = $params['id'] ?? NULL;
$action = $contributionID ? 'edit' : 'create';
$duplicates = [];
if (self::checkDuplicate($params, $duplicates, $contributionID)) {
Expand Down

0 comments on commit 87c5b5b

Please sign in to comment.