mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-08 07:03:23 -06:00
35 lines
669 B
PHP
35 lines
669 B
PHP
<?php
|
|
declare(strict_types = 1);
|
|
namespace FireflyIII\Helpers\Csv\Mapper;
|
|
|
|
use Auth;
|
|
use FireflyIII\Models\Bill as BillModel;
|
|
|
|
/**
|
|
* Class Bill
|
|
*
|
|
* @package FireflyIII\Helpers\Csv\Mapper
|
|
*/
|
|
class Bill implements MapperInterface
|
|
{
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getMap(): array
|
|
{
|
|
$result = Auth::user()->bills()->get(['bills.*']);
|
|
$list = [];
|
|
|
|
/** @var BillModel $bill */
|
|
foreach ($result as $bill) {
|
|
$list[$bill->id] = $bill->name . ' [' . $bill->match . ']';
|
|
}
|
|
asort($list);
|
|
|
|
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
|
|
|
|
return $list;
|
|
}
|
|
}
|