2014-07-30 07:45:46 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Firefly\Helper\Controllers;
|
|
|
|
|
|
|
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
|
2014-08-10 08:01:46 -05:00
|
|
|
/**
|
|
|
|
* Class Category
|
|
|
|
*
|
|
|
|
* @package Firefly\Helper\Controllers
|
|
|
|
*/
|
2014-07-30 07:45:46 -05:00
|
|
|
class Category implements CategoryInterface
|
|
|
|
{
|
2014-08-10 08:01:46 -05:00
|
|
|
/**
|
|
|
|
* @param \Category $category
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-30 07:45:46 -05:00
|
|
|
public function journalsInRange(\Category $category, Carbon $start, Carbon $end)
|
|
|
|
{
|
2014-08-02 00:34:38 -05:00
|
|
|
return $category->transactionjournals()->with(
|
2014-08-10 04:30:14 -05:00
|
|
|
['transactions', 'transactions.account', 'transactiontype', 'components']
|
|
|
|
)->orderBy('date', 'DESC')->orderBy('id', 'DESC')->before($end)->after($start)->get();
|
2014-07-30 07:45:46 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|