2016-07-02 13:40:23 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* TransactionCurrencies.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
2016-10-04 23:52:15 -05:00
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
2016-07-02 13:40:23 -05:00
|
|
|
*/
|
|
|
|
|
2017-04-09 00:44:22 -05:00
|
|
|
declare(strict_types=1);
|
2016-07-02 13:40:23 -05:00
|
|
|
|
|
|
|
namespace FireflyIII\Import\Mapper;
|
|
|
|
|
2017-02-24 22:57:01 -06:00
|
|
|
use FireflyIII\Models\TransactionCurrency;
|
2016-07-02 13:40:23 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class TransactionCurrencies
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Import\Mapper
|
|
|
|
*/
|
|
|
|
class TransactionCurrencies implements MapperInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getMap(): array
|
|
|
|
{
|
2017-02-24 22:57:01 -06:00
|
|
|
$currencies = TransactionCurrency::get();
|
2016-07-02 13:40:23 -05:00
|
|
|
$list = [];
|
|
|
|
foreach ($currencies as $currency) {
|
|
|
|
$list[$currency->id] = $currency->name . ' (' . $currency->code . ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
asort($list);
|
|
|
|
|
|
|
|
$list = [0 => trans('csv.do_not_map')] + $list;
|
|
|
|
|
|
|
|
return $list;
|
|
|
|
|
|
|
|
}
|
2016-08-12 08:10:03 -05:00
|
|
|
}
|