mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-08 23:24:07 -06:00
34 lines
628 B
PHP
34 lines
628 B
PHP
<?php
|
|
|
|
namespace FireflyIII\Helpers\Csv\Mapper;
|
|
|
|
use Auth;
|
|
use FireflyIII\Models\Budget as BudgetModel;
|
|
|
|
/**
|
|
* Class Budget
|
|
*
|
|
* @package FireflyIII\Helpers\Csv\Mapper
|
|
*/
|
|
class Budget implements MapperInterface
|
|
{
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getMap()
|
|
{
|
|
$result = Auth::user()->budgets()->get(['budgets.*']);
|
|
$list = [];
|
|
|
|
/** @var BudgetModel $budget */
|
|
foreach ($result as $budget) {
|
|
$list[$budget->id] = $budget->name;
|
|
}
|
|
asort($list);
|
|
|
|
array_unshift($list, trans('firefly.csv_do_not_map'));
|
|
|
|
return $list;
|
|
}
|
|
} |