* @param boolean $all_contribs Pass as 'all_contribs' param. The var may also be null to exclude it
* @param boolean $gift_redeem_page_id Pass as 'gift_redeem_page_id' param. The var may also be null to exclude it
*/
- $meets_a_donation_criterion = function ($query_name, $amount, $extra_params)
+ $meets_a_donation_criterion = function ($query_name, $extra_params, $amount)
use ($username, $start_date, $end_date, $attributes) {
$parameters = ['username' => $username];
return false;
};
- if (($meets_a_donation_criterion('query_nomination_process_donations',
- intval($this->donation_threshold), ['all_contribs' => true, 'start_date' => $start_date, 'end_date' => $end_date])
+ $donation_params = ['start_date' => $start_date, 'end_date' => $end_date, 'all_contribs' => true];
+ $membership_params = ['start_date' => $start_date, 'end_date' => $end_date, 'all_contribs' => false];
+ $gift_member_params = ['start_date' => $start_date, 'end_date' => $end_date, 'gift_redeem_page_id' => intval($this->gift_redeem_page_id)];
+ $adhoc_params = ['adhoc_access_group_id' => intval($this->adhoc_access_group_id)];
- || $meets_a_donation_criterion('query_nomination_process_donations',
- intval($this->membership_donation_threshold), ['all_contribs' => false, 'start_date' => $start_date, 'end_date' => $end_date])
-
- || $meets_a_donation_criterion('query_nomination_process_gift_receipt',
- 1, ['gift_redeem_page_id' => intval($this->gift_redeem_page_id), 'start_date' => $start_date, 'end_date' => $end_date])
-
- || $meets_a_donation_criterion('query_nomination_process_adhoc',
- 1, ['adhoc_access_group_id' => intval($this->adhoc_access_group_id)])
+ if (($meets_a_donation_criterion('query_nomination_process_donations', $donation_params, intval($this->donation_threshold))
+ || $meets_a_donation_criterion('query_nomination_process_donations', $membership_params, intval($this->membership_donation_threshold))
+ || $meets_a_donation_criterion('query_nomination_process_gift_receipt', $gift_member_params, 1)
+ || $meets_a_donation_criterion('query_nomination_process_adhoc', $adhoc_params, 1)
)
&& ($attributes['is_member'] == ['true'])) {