mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-08 07:03:23 -06:00
29 lines
610 B
PHP
29 lines
610 B
PHP
<?php
|
|
|
|
namespace FireflyIII\Helpers\Csv\Converter;
|
|
|
|
use FireflyIII\Models\TransactionCurrency;
|
|
|
|
/**
|
|
* Class CurrencyId
|
|
*
|
|
* @package FireflyIII\Helpers\Csv\Converter
|
|
*/
|
|
class CurrencyId extends BasicConverter implements ConverterInterface
|
|
{
|
|
|
|
/**
|
|
* @return mixed|static
|
|
*/
|
|
public function convert()
|
|
{
|
|
if (isset($this->mapped[$this->index][$this->value])) {
|
|
$currency = TransactionCurrency::find($this->mapped[$this->index][$this->value]);
|
|
} else {
|
|
$currency = TransactionCurrency::find($this->value);
|
|
}
|
|
|
|
return $currency;
|
|
}
|
|
}
|