mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-09 19:28:19 +00:00
There's a giant mix brewing between "old" code, bad code and not implemented exceptions. I suspect the next change will be to cut out all old stuff, throw a lot of NotImplementedExceptions and get going.
This commit is contained in:
64
app/lib/FireflyIII/Shared/Toolkit/Navigation.php
Normal file
64
app/lib/FireflyIII/Shared/Toolkit/Navigation.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Shared\Toolkit;
|
||||
|
||||
/**
|
||||
* Class Navigation
|
||||
*
|
||||
* @package FireflyIII\Shared\Toolkit
|
||||
*/
|
||||
class Navigation
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
* @throws \Firefly\Exception\FireflyException
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
/*
|
||||
* Get the start date and the range from the session
|
||||
*/
|
||||
|
||||
$filter = new Filter;
|
||||
|
||||
$range = $filter->setSessionRangeValue();
|
||||
$start = \Session::get('start');
|
||||
|
||||
/*
|
||||
* Add some period to $start.
|
||||
*/
|
||||
$next = $filter->next($range, clone $start);
|
||||
|
||||
/*
|
||||
* Save in session:
|
||||
*/
|
||||
\Session::put('start', $next);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws \Firefly\Exception\FireflyException
|
||||
*/
|
||||
public function prev()
|
||||
{
|
||||
/*
|
||||
* Get the start date and the range from the session
|
||||
*/
|
||||
$filter = new Filter;
|
||||
|
||||
$range = $filter->setSessionRangeValue();
|
||||
$start = \Session::get('start');
|
||||
|
||||
/*
|
||||
* Substract some period to $start.
|
||||
*/
|
||||
$prev = $filter->previous($range, clone $start);
|
||||
|
||||
/*
|
||||
* Save in session:
|
||||
*/
|
||||
\Session::put('start', $prev);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user