Removed unused methods.

This commit is contained in:
James Cole 2015-01-25 12:21:56 +01:00
parent f3460cca49
commit ba2a40bdf3
5 changed files with 9 additions and 57 deletions

View File

@ -187,16 +187,6 @@ class Bill implements CUDInterface, CommonDatabaseCallsInterface, BillInterface
throw new NotImplementedException; throw new NotImplementedException;
} }
/**
* Returns all objects.
*
* @return Collection
*/
public function getActive()
{
return $this->getUser()->bills()->where('active', 1)->get();
}
/** /**
* @param \Bill $bill * @param \Bill $bill
* *

View File

@ -261,26 +261,6 @@ class Budget implements CUDInterface, CommonDatabaseCallsInterface, BudgetInterf
return $budget->limitrepetitions()->where('limit_repetitions.startdate', $date)->first(['limit_repetitions.*']); return $budget->limitrepetitions()->where('limit_repetitions.startdate', $date)->first(['limit_repetitions.*']);
} }
/**
* @param \Budget $budget
* @param int $limit
*
* @return \Illuminate\Pagination\Paginator
*/
public function getTransactionJournals(\Budget $budget, $limit = 50)
{
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;
$set = $budget->transactionJournals()->withRelevantData()->take($limit)->offset($offset)->orderBy('date', 'DESC')->get(['transaction_journals.*']);
$count = $budget->transactionJournals()->count();
$items = [];
foreach ($set as $entry) {
$items[] = $entry;
}
return \Paginator::make($items, $count, $limit);
}
/** /**
* @param \Budget $budget * @param \Budget $budget
* @param Carbon $date * @param Carbon $date

View File

@ -78,14 +78,11 @@ class PiggyBankShared
* *
* @return Collection * @return Collection
* @throws NotImplementedException * @throws NotImplementedException
* @codeCoverageIgnore
*/ */
public function getByIds(array $ids) public function getByIds(array $ids)
{ {
return \PiggyBank:: throw new NotImplementedException;
leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->whereIn('piggy_banks.id', [$ids])->where(
'accounts.user_id', $this->getUser()->id
)
->first(['piggy_banks.*']);
} }
/** /**

View File

@ -397,11 +397,15 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
* *
* @param int $objectId * @param int $objectId
* *
* @codeCoverageIgnore
* @throws NotImplementedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @return \Eloquent * @return \Eloquent
*/ */
public function find($objectId) public function find($objectId)
{ {
return $this->getUser()->transactionjournals()->find($objectId); throw new NotImplementedException;
} }
/** /**
@ -424,11 +428,11 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
* Returns all objects. * Returns all objects.
* *
* @return Collection * @return Collection
* @codeCoverageIgnore
*/ */
public function get() public function get()
{ {
return $this->getUser()->transactionjournals()->with(['TransactionType', 'transactions', 'transactions.account', 'transactions.account.accountType']) throw new NotImplementedException;
->get();
} }
/** /**
@ -462,17 +466,6 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
return $this->getUser()->transactionjournals()->orderBy('date', 'ASC')->first(); return $this->getUser()->transactionjournals()->orderBy('date', 'ASC')->first();
} }
/**
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getInDateRange(Carbon $start, Carbon $end)
{
return $this->getuser()->transactionjournals()->withRelevantData()->before($end)->after($start)->get();
}
/** /**
* @param Carbon $date * @param Carbon $date
* *

View File

@ -19,14 +19,6 @@ interface TransactionJournalInterface
*/ */
public function first(); public function first();
/**
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getInDateRange(Carbon $start, Carbon $end);
/** /**
* @param Carbon $date * @param Carbon $date
* *