mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
27 lines
626 B
PHP
27 lines
626 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace FireflyIII\Helpers\Csv\Converter;
|
||
|
|
use FireflyIII\Models\TransactionCurrency;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Class CurrencyName
|
||
|
|
*
|
||
|
|
* @package FireflyIII\Helpers\Csv\Converter
|
||
|
|
*/
|
||
|
|
class CurrencyName 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::whereName($this->value)->first();
|
||
|
|
}
|
||
|
|
|
||
|
|
return $currency;
|
||
|
|
}
|
||
|
|
}
|