2016-07-02 20:40:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* TransactionCurrencies.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
2016-10-05 06:52:15 +02: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 20:40:23 +02:00
|
|
|
*/
|
|
|
|
|
2017-04-09 07:44:22 +02:00
|
|
|
declare(strict_types=1);
|
2016-07-02 20:40:23 +02:00
|
|
|
|
|
|
|
namespace FireflyIII\Import\Mapper;
|
|
|
|
|
2017-02-25 05:57:01 +01:00
|
|
|
use FireflyIII\Models\TransactionCurrency;
|
2016-07-02 20:40:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class TransactionCurrencies
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Import\Mapper
|
|
|
|
*/
|
|
|
|
class TransactionCurrencies implements MapperInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getMap(): array
|
|
|
|
{
|
2017-02-25 05:57:01 +01:00
|
|
|
$currencies = TransactionCurrency::get();
|
2016-07-02 20:40:23 +02:00
|
|
|
$list = [];
|
|
|
|
foreach ($currencies as $currency) {
|
|
|
|
$list[$currency->id] = $currency->name . ' (' . $currency->code . ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
asort($list);
|
|
|
|
|
2017-06-24 06:57:24 +02:00
|
|
|
$list = [0 => trans('csv.map_do_not_map')] + $list;
|
2016-07-02 20:40:23 +02:00
|
|
|
|
|
|
|
return $list;
|
|
|
|
|
|
|
|
}
|
2016-08-12 15:10:03 +02:00
|
|
|
}
|