mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expanded on categories.
This commit is contained in:
@@ -170,6 +170,20 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
public function getTransactionJournals(\Category $category, $limit = 50)
|
||||
{
|
||||
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;
|
||||
$set = $category->transactionJournals()->withRelevantData()->take($limit)->offset($offset)->orderBy('date', 'DESC')->get(['transaction_journals.*']);
|
||||
$count = $category->transactionJournals()->count();
|
||||
$items = [];
|
||||
foreach ($set as $entry) {
|
||||
$items[] = $entry;
|
||||
}
|
||||
|
||||
return \Paginator::make($items, $count, $limit);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Category $budget
|
||||
* @param Carbon $date
|
||||
|
Reference in New Issue
Block a user