*/
public function listContribution() {
$rows = civicrm_api3('Contribution', 'get', [
- 'options' => ['limit' => 12],
+ 'options' => [
+ 'limit' => 12,
+ 'sort' => 'receive_date DESC',
+ ],
'sequential' => 1,
'contact_id' => $this->_contactId,
'return' => [
],
])['values'];
+ // We want oldest first, just among the most recent contributions
+ $rows = array_reverse($rows);
+
foreach ($rows as $index => $row) {
// This is required for tpl logic. We should move away from hard-code this to adding an array of actions to the row
// which the tpl can iterate through - this should allow us to cope with competing attempts to add new buttons