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