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