NOTE: This is a technical subticket of T328075: Move tracking out of donation data blob
This ticket is about changing the "Donations Per Campaign" report to query the database for donations with matching campaign and keywords instead of iterating over donations and checking the tracking data in PHP.
Affected repositories
- Fundraising Operation Center
Implementation Details:
The PHP code of DonationsPerCampaign does a lot what should be done with SQL GROUP BY and aggregation functions (SUM, COUNT). Replace the GetDonationsTrait with a Doctrine DBAL instance and a query to build the result data structure from a database result with aggregated data instead of getDonations and counting individual donations.
Use database fixtures to check if the query is working and get rid of the GetDonationsTrait