Code cleanup.

This commit is contained in:
James Cole
2015-05-05 10:23:01 +02:00
parent 67fdd27499
commit 23a09b7081
37 changed files with 112 additions and 62 deletions

View File

@@ -27,13 +27,13 @@ class JournalRepository implements JournalRepositoryInterface
{
/**
* @param int $id
* @param int $reminderId
*
* @return bool
*/
public function deactivateReminder($id)
public function deactivateReminder($reminderId)
{
$reminder = Auth::user()->reminders()->find($id);
$reminder = Auth::user()->reminders()->find($reminderId);
if ($reminder) {
$reminder->active = 0;
$reminder->save();
@@ -195,6 +195,7 @@ class JournalRepository implements JournalRepositoryInterface
// store or get budget
if (intval($data['budget_id']) > 0) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::find($data['budget_id']);
$journal->budgets()->save($budget);
}
@@ -254,6 +255,7 @@ class JournalRepository implements JournalRepositoryInterface
// unlink all budgets and recreate them:
$journal->budgets()->detach();
if (intval($data['budget_id']) > 0) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::find($data['budget_id']);
$journal->budgets()->save($budget);
}

View File

@@ -17,11 +17,11 @@ use Illuminate\Support\Collection;
interface JournalRepositoryInterface
{
/**
* @param int $id
* @param int $reminderId
*
* @return bool
*/
public function deactivateReminder($id);
public function deactivateReminder($reminderId);
/**
* @param TransactionJournal $journal