mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-23 23:13:18 -06:00
32 lines
570 B
PHP
32 lines
570 B
PHP
|
<?php
|
||
|
|
||
|
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()
|
||
|
{
|
||
|
$result = Auth::user()->bills()->get(['bills.*']);
|
||
|
$list = [];
|
||
|
|
||
|
/** @var BillModel $bill */
|
||
|
foreach ($result as $bill) {
|
||
|
$list[$bill->id] = $bill->name . ' [' . $bill->match . ']';
|
||
|
}
|
||
|
asort($list);
|
||
|
|
||
|
return $list;
|
||
|
}
|
||
|
}
|