firefly-iii/app/Helpers/Csv/Mapper/Budget.php

34 lines
628 B
PHP
Raw Normal View History

2015-07-05 11:18:44 -05:00
<?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);
2015-07-06 01:14:19 -05:00
array_unshift($list, trans('firefly.csv_do_not_map'));
2015-07-05 11:18:44 -05:00
return $list;
}
}