. */ declare(strict_types=1); namespace FireflyIII\Import\Mapper; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; /** * Class Bills. */ class Bills implements MapperInterface { /** * @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 = intval($bill->id); $list[$billId] = $bill->name . ' [' . $bill->match . ']'; } asort($list); $list = [0 => trans('import.map_do_not_map')] + $list; return $list; } }