mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
Moar updates.
This commit is contained in:
@@ -12,6 +12,26 @@ use Carbon\Carbon;
|
||||
*/
|
||||
class EloquentReminderRepository implements ReminderRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param \User $user
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function overruleUser(\User $user)
|
||||
{
|
||||
$this->_user = $user;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected $_user = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_user = \Auth::user();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Reminder $reminder
|
||||
*
|
||||
@@ -42,7 +62,7 @@ class EloquentReminderRepository implements ReminderRepositoryInterface
|
||||
{
|
||||
$today = new Carbon;
|
||||
|
||||
return \Auth::user()->reminders()->validOn($today)->get();
|
||||
return $this->_user->reminders()->validOn($today)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,8 +72,8 @@ class EloquentReminderRepository implements ReminderRepositoryInterface
|
||||
{
|
||||
$today = new Carbon;
|
||||
|
||||
return \Auth::user()->reminders()->with('recurringtransaction')->validOn($today)->where(
|
||||
'class', 'RecurringTransactionReminder'
|
||||
return $this->_user->reminders()->with('recurringtransaction')->validOn($today)->where(
|
||||
'class', 'RecurringTransactionReminder'
|
||||
)->get();
|
||||
|
||||
}
|
||||
|
@@ -39,4 +39,10 @@ interface ReminderRepositoryInterface
|
||||
|
||||
public function getCurrentRecurringReminders();
|
||||
|
||||
/**
|
||||
* @param \User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function overruleUser(\User $user);
|
||||
|
||||
}
|
Reference in New Issue
Block a user