Refactor budget controller.

This commit is contained in:
James Cole
2018-07-14 15:22:21 +02:00
parent 6bc772d640
commit b8699422c8
19 changed files with 2087 additions and 1495 deletions

View File

@@ -95,8 +95,6 @@ class BudgetLimitController extends Controller
{
$manager = new Manager;
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
$start = null;
$end = null;
$budgetId = (int)($request->get('budget_id') ?? 0);
$budget = $this->repository->findNull($budgetId);
$this->parameters->set('budget_id', $budgetId);
@@ -119,9 +117,11 @@ class BudgetLimitController extends Controller
$collection = new Collection;
if (null === $budget) {
/** @noinspection PhpUndefinedVariableInspection */
$collection = $this->repository->getAllBudgetLimits($start, $end);
}
if (null !== $budget) {
/** @noinspection PhpUndefinedVariableInspection */
$collection = $this->repository->getBudgetLimits($budget, $start, $end);
}