mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Update API and transaction components.
This commit is contained in:
@@ -118,6 +118,25 @@ class GroupCollector implements GroupCollectorInterface
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the transaction journals without group information. Is useful in some instances.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getExtractedJournals(): array
|
||||
{
|
||||
$selection = $this->getGroups();
|
||||
$return = new Collection;
|
||||
/** @var array $group */
|
||||
foreach ($selection as $group) {
|
||||
foreach ($group['transactions'] as $journalId => $journal) {
|
||||
$return[$journalId] = $journal;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the groups.
|
||||
*
|
||||
@@ -339,6 +358,18 @@ class GroupCollector implements GroupCollectorInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the search to one specific transaction group.
|
||||
*
|
||||
* @param TransactionGroup $transactionGroup
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setTransactionGroup(TransactionGroup $transactionGroup): GroupCollectorInterface
|
||||
{
|
||||
$this->query->where('transaction_groups.id', $transactionGroup->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the included transaction types.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user