mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-09 15:43:19 -06:00
32 lines
564 B
PHP
32 lines
564 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);
|
||
|
|
||
|
return $list;
|
||
|
}
|
||
|
}
|