mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add missing method.
This commit is contained in:
parent
fa31483b02
commit
c9fefcd8f4
@ -239,6 +239,14 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
$currency->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function findByName(string $name): ?TransactionCurrency
|
||||
{
|
||||
return TransactionCurrency::where('name', $name)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find by object, ID or code. Returns user default or system default.
|
||||
*
|
||||
|
@ -84,6 +84,13 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function findByCode(string $currencyCode): ?TransactionCurrency;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return TransactionCurrency|null
|
||||
*/
|
||||
public function findByName(string $name): ?TransactionCurrency;
|
||||
|
||||
/**
|
||||
* Find by object, ID or code. Returns user default or system default.
|
||||
*
|
||||
|
@ -1536,9 +1536,9 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$parts = explode(' ', $value);
|
||||
$value = trim($parts[count($parts) - 1], "() \t\n\r\0\x0B");
|
||||
}
|
||||
$result = $this->currencyRepository->findByCodeNull($value);
|
||||
$result = $this->currencyRepository->findByCode($value);
|
||||
if (null === $result) {
|
||||
$result = $this->currencyRepository->findByNameNull($value);
|
||||
$result = $this->currencyRepository->findByName($value);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Loading…
Reference in New Issue
Block a user