Page MenuHomePhabricator

Use database query instead of entities for querying comments
Open, Needs TriagePublic

Description

With changes to the payment domain, the comment finder now uses the deprecated getAmount method from the Donation Doctrine entity. Instead, it should use a raw database query, joining the payments table.

Acceptance criteria

  • The CommentFinder class does not use deprecated methods any more

Implementation notes
The CommentFinder class already provides a "view model" (CommentWithAmount) that's detached from the actual database structure. Detach it more by using a raw DBAL query (using SQL or a query builder).

When the comments get factored out from donations into their own table, we can think of denormalizing the data a bit, adding the amount to the comment table to avoid a JOIN. But that's not part of this ticket.