mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Merge pull request #9946 from firefly-iii/fix-currency-autocomplete
Add missing method to repository.
This commit is contained in:
@@ -38,6 +38,16 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
|
|||||||
{
|
{
|
||||||
use UserGroupTrait;
|
use UserGroupTrait;
|
||||||
|
|
||||||
|
public function searchCurrency(string $search, int $limit): Collection
|
||||||
|
{
|
||||||
|
$query = TransactionCurrency::where('enabled', true);
|
||||||
|
if ('' !== $search) {
|
||||||
|
$query->whereLike('name', sprintf('%%%s%%', $search));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $query->take($limit)->get();
|
||||||
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function find(int $currencyId): ?TransactionCurrency
|
public function find(int $currencyId): ?TransactionCurrency
|
||||||
{
|
{
|
||||||
|
@@ -34,6 +34,7 @@ use Illuminate\Support\Collection;
|
|||||||
interface CurrencyRepositoryInterface
|
interface CurrencyRepositoryInterface
|
||||||
{
|
{
|
||||||
public function find(int $currencyId): ?TransactionCurrency;
|
public function find(int $currencyId): ?TransactionCurrency;
|
||||||
|
public function searchCurrency(string $search, int $limit): Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find by currency code, return NULL if unfound.
|
* Find by currency code, return NULL if unfound.
|
||||||
|
Reference in New Issue
Block a user