. */ declare(strict_types=1); namespace FireflyIII\Import\Mapper; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; /** * Class Budgets. */ class Budgets implements MapperInterface { /** * Get map of budgets. * * @return array */ public function getMap(): array { /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); $result = $repository->getActiveBudgets(); $list = []; /** @var Budget $budget */ foreach ($result as $budget) { $budgetId = (int)$budget->id; $list[$budgetId] = $budget->name; } asort($list); $list = [0 => (string)trans('import.map_do_not_map')] + $list; return $list; } }