X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FBAO%2FParticipantPayment.php;h=101448314977aa04618af718ae62b740236bd5c8;hb=10525e4437a80b3f750037373d57a56888c45d82;hp=4a2008823b2db4605dfb90cc405140cd154ec13c;hpb=6049c0d89e4b18c81cea8108acc71ba6bdc3ba85;p=civicrm-core.git diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php index 4a2008823b..1014483149 100644 --- a/CRM/Event/BAO/ParticipantPayment.php +++ b/CRM/Event/BAO/ParticipantPayment.php @@ -38,12 +38,13 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment /** * Creates or updates a participant payment record * - * @param $params - * Array of values to initialize the record with. - * @param $ids - * Array with one values of id for this participantPayment record (for update). + * @param array $params + * of values to initialize the record with. + * @param array $ids + * with one values of id for this participantPayment record (for update). * - * @return object the partcipant payment record + * @return object + * the partcipant payment record * @static */ public static function create(&$params, &$ids) { @@ -73,12 +74,20 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment //generally if people are creating participant_payments via the api they won't be setting the line item correctly - we can't help them if they are doing complex transactions // but if they have a single line item for the contribution we can assume it should refer to the participant line - $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array(1 => array($participantPayment->contribution_id, 'Integer'))); + $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array( + 1 => array( + $participantPayment->contribution_id, + 'Integer' + ) + )); if ($lineItemCount == 1) { $sql = "UPDATE civicrm_line_item li SET entity_table = 'civicrm_participant', entity_id = %1 WHERE contribution_id = %2 AND entity_table = 'civicrm_contribution'"; - CRM_Core_DAO::executeQuery($sql, array(1 => array($participantPayment->participant_id, 'Integer'), 2 => array($participantPayment->contribution_id, 'Integer'))); + CRM_Core_DAO::executeQuery($sql, array( + 1 => array($participantPayment->participant_id, 'Integer'), + 2 => array($participantPayment->contribution_id, 'Integer') + )); } return $participantPayment; @@ -91,7 +100,8 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment * @param array $params * Associative array whose values match the record to be deleted. * - * @return boolean true if deleted false otherwise + * @return boolean + * true if deleted false otherwise * @static */ public static function deleteParticipantPayment($params) {