mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 16:00:13 +00:00
Add currency limit, without currency code #3150
This commit is contained in:
@@ -476,17 +476,18 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param string $search
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function searchCurrency(string $search): Collection
|
||||
public function searchCurrency(string $search, int $limit): Collection
|
||||
{
|
||||
$query = TransactionCurrency::where('enabled', 1);
|
||||
if ('' !== $search) {
|
||||
$query->where('name', 'LIKE', sprintf('%%%s%%', $search));
|
||||
}
|
||||
|
||||
return $query->get();
|
||||
return $query->take($limit)->get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -230,10 +230,11 @@ interface CurrencyRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param string $search
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function searchCurrency(string $search): Collection;
|
||||
public function searchCurrency(string $search, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
|
Reference in New Issue
Block a user