CiviCRM Asked by safron on August 30, 2021
I want to get all the contribution table entries as a list which are equivalent to a given ID.
My contribution table has 4 entries and the contact ID for all the four contribution is 2.
I’m using the below method to get the details, but which takes the given ID as contactID and return the entries when contactID = contributionID..
foreach ($values as $key => $value){
$contributionID = $values[$key]; //contribution IDs are 1,2,3,4,5
// get the details for all selected contacts
list($contributionDetails) = CRM_Utils_Token::getTokenDetails(array($contributionID),
$this->_returnProperties,
NULL, NULL, FALSE,
$this->_allTokens
);
Mean this only returns a row where contribution ID = contact ID = 2..but i want to get all the raw where contribution id is equal to 1,2,3,4 and 5.. how should i get it?
Thanks in advance!
You can use CRM_Contribute_BAO_Contribution::getContributionTokenValues() function to get details of contribution based on contribution id.
To get all data of contribution you can use api
$contributionData = civicrm_api3('Contribution', 'getsingle', ['id' => $contributionId]);
Correct answer by Pradeep Nayak on August 30, 2021
2 Asked on January 7, 2021 by christia
1 Asked on January 5, 2021 by graham
1 Asked on December 26, 2020 by tee-strong
1 Asked on December 20, 2020 by sts99
1 Asked on December 18, 2020 by paul77
2 Asked on December 10, 2020 by vanessa-davila
1 Asked on December 2, 2020 by pratik-devlekar
2 Asked on December 2, 2020 by nielo
1 Asked on December 2, 2020 by filip-maes
1 Asked on November 1, 2020 by alice-aguilar
1 Asked on August 30, 2020 by guillaume-sorel
1 Asked on August 16, 2020 by josh
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP