mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Expand collector to return single journals.
This commit is contained in:
parent
e89a77efb1
commit
45aa76afce
@ -488,6 +488,23 @@ class JournalCollector implements JournalCollectorInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $journals
|
||||
*
|
||||
* @return JournalCollectorInterface
|
||||
*/
|
||||
public function setJournals(Collection $journals): JournalCollectorInterface
|
||||
{
|
||||
$ids = $journals->pluck('id')->toArray();
|
||||
$this->query->where(
|
||||
function (EloquentBuilder $q) use ($ids) {
|
||||
$q->whereIn('transaction_journals.id', $ids);
|
||||
}
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*
|
||||
|
@ -42,6 +42,13 @@ interface JournalCollectorInterface
|
||||
*/
|
||||
public function addFilter(string $filter): JournalCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param Collection $journals
|
||||
*
|
||||
* @return JournalCollectorInterface
|
||||
*/
|
||||
public function setJournals(Collection $journals): JournalCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $amount
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user