Cleanup, mostly I removed the coding standard ignore instructions.

This commit is contained in:
James Cole
2014-12-20 22:07:21 +01:00
parent 073fd5aa0d
commit 2072607889
13 changed files with 102 additions and 169 deletions

View File

@@ -48,7 +48,7 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
*/
public function store(array $data)
{
$budget = new \Budget($data);
$budget = new \Budget($data);
if (!$budget->isValid()) {
\Log::error('Could not store budget: ' . $budget->getErrors()->toJson());
@@ -85,9 +85,9 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
{
$warnings = new MessageBag;
$successes = new MessageBag;
$budget = new \Budget($model);
$budget = new \Budget($model);
$budget->isValid();
$errors = $budget->getErrors();
$errors = $budget->getErrors();
if (!$errors->has('name')) {
$successes->add('name', 'OK');
@@ -180,6 +180,17 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
return \Paginator::make($items, $count, $take);
}
/**
* @param \Budget $budget
* @param Carbon $date
*
* @return \LimitRepetition
*/
public function getRepetitionByDate(\Budget $budget, Carbon $date)
{
return $budget->limitrepetitions()->where('limit_repetitions.startdate', $date)->first(['limit_repetitions.*']);
}
/**
* @param \Budget $budget
* @param int $limit