Implement all setUser methods.

This commit is contained in:
James Cole
2017-01-30 16:42:58 +01:00
parent 84e380e4d0
commit 311c1a3c84
17 changed files with 120 additions and 24 deletions

View File

@@ -323,6 +323,14 @@ class AccountRepository implements AccountRepositoryInterface
return $journal->date; return $journal->date;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param array $data * @param array $data
* *

View File

@@ -27,11 +27,6 @@ use Illuminate\Support\Collection;
interface AccountRepositoryInterface interface AccountRepositoryInterface
{ {
/**
* @param User $user
*/
public function setUser(User $user);
/** /**
* Moved here from account CRUD. * Moved here from account CRUD.
* *
@@ -130,6 +125,11 @@ interface AccountRepositoryInterface
*/ */
public function oldestJournalDate(Account $account): Carbon; public function oldestJournalDate(Account $account): Carbon;
/**
* @param User $user
*/
public function setUser(User $user);
/** /**
* @param array $data * @param array $data
* *

View File

@@ -155,6 +155,14 @@ class AccountTasker implements AccountTaskerInterface
return $return; return $return;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* Will return how much money has been going out (ie. spent) by the given account(s). * Will return how much money has been going out (ie. spent) by the given account(s).
* Alternatively, will return how much money has been coming in (ie. earned) by the given accounts. * Alternatively, will return how much money has been coming in (ie. earned) by the given accounts.

View File

@@ -24,11 +24,6 @@ use Illuminate\Support\Collection;
*/ */
interface AccountTaskerInterface interface AccountTaskerInterface
{ {
/**
* @param User $user
*/
public function setUser(User $user);
/** /**
* @param Collection $accounts * @param Collection $accounts
* @param Collection $excluded * @param Collection $excluded
@@ -62,4 +57,9 @@ interface AccountTaskerInterface
*/ */
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array; public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array;
/**
* @param User $user
*/
public function setUser(User $user);
} }

View File

@@ -30,7 +30,13 @@ class AttachmentRepository implements AttachmentRepositoryInterface
{ {
/** @var User */ /** @var User */
private $user; private $user;
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* AttachmentRepository constructor. * AttachmentRepository constructor.
* *

View File

@@ -36,7 +36,13 @@ class BillRepository implements BillRepositoryInterface
/** @var User */ /** @var User */
private $user; private $user;
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* BillRepository constructor. * BillRepository constructor.
* *

View File

@@ -47,7 +47,13 @@ class BudgetRepository implements BudgetRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @return bool * @return bool
*/ */

View File

@@ -43,7 +43,13 @@ class CategoryRepository implements CategoryRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param Category $category * @param Category $category
* *

View File

@@ -39,7 +39,13 @@ class CurrencyRepository implements CurrencyRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param TransactionCurrency $currency * @param TransactionCurrency $currency
* *

View File

@@ -38,7 +38,13 @@ class ExportJobRepository implements ExportJobRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param ExportJob $job * @param ExportJob $job
* @param string $status * @param string $status

View File

@@ -37,7 +37,13 @@ class ImportJobRepository implements ImportJobRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param string $fileType * @param string $fileType
* *

View File

@@ -52,7 +52,13 @@ class JournalRepository implements JournalRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param TransactionJournal $journal * @param TransactionJournal $journal
* @param TransactionType $type * @param TransactionType $type

View File

@@ -152,6 +152,14 @@ class JournalTasker implements JournalTaskerInterface
return $transactions; return $transactions;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* Collect the balance of an account before the given transaction has hit. This is tricky, because * Collect the balance of an account before the given transaction has hit. This is tricky, because
* the balance does not depend on the transaction itself but the journal it's part of. And of course * the balance does not depend on the transaction itself but the journal it's part of. And of course

View File

@@ -41,7 +41,13 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* @param string $amount * @param string $amount

View File

@@ -39,7 +39,13 @@ class RuleRepository implements RuleRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @return int * @return int
*/ */

View File

@@ -39,7 +39,13 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* @return int * @return int
*/ */

View File

@@ -43,7 +43,13 @@ class TagRepository implements TagRepositoryInterface
{ {
$this->user = $user; $this->user = $user;
} }
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/** /**
* *
* @param TransactionJournal $journal * @param TransactionJournal $journal