$cs = new CRM_Contribute_DAO_ContributionSoft();
$cs->copyValues($params);
$softContribution = array();
- if ($cs->find(TRUE)) {
- if ($all) {
- foreach (array(
- 'pcp_id', 'pcp_display_in_roll', 'pcp_roll_nickname', 'pcp_personal_note') as $key => $val) {
- $softContribution[$val] = $cs->$val;
+ $cs->find();
+ if ($cs->N > 0) {
+ while ($cs->fetch()) {
+
+ if ($all) {
+ foreach (array(
+ 'pcp_id', 'pcp_display_in_roll', 'pcp_roll_nickname', 'pcp_personal_note') as $key => $val) {
+ $softContribution[$val] = $cs->$val;
+ }
}
+ $softContribution[$cs->id]['soft_credit_to'] = $cs->contact_id;
+ $softContribution[$cs->id]['soft_credit_id'] = $cs->id;
+ $softContribution[$cs->id]['soft_credit_amount'] = $cs->amount;
}
- $softContribution['soft_credit_to'] = $cs->contact_id;
- $softContribution['soft_credit_id'] = $cs->id;
- $softContribution['soft_credit_amount'] = $cs->amount;
-
}
return $softContribution;
}