mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 00:27:30 +00:00
Updated routes for auto-complete.
This commit is contained in:
@@ -403,4 +403,19 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
{
|
||||
$this->user->piggyBanks()->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function searchPiggyBank(string $query, int $limit): Collection
|
||||
{
|
||||
$search = $this->user->piggyBanks();
|
||||
if ('' !== $query) {
|
||||
$search->where('piggy_banks.name', 'LIKE', sprintf('%%%s%%', $query));
|
||||
}
|
||||
$search->orderBy('piggy_banks.order', 'ASC')
|
||||
->orderBy('piggy_banks.name', 'ASC')->where('piggy_banks.active', 1);
|
||||
|
||||
return $search->take($limit)->get();
|
||||
}
|
||||
}
|
||||
|
@@ -145,6 +145,16 @@ interface PiggyBankRepositoryInterface
|
||||
*/
|
||||
public function findByName(string $name): ?PiggyBank;
|
||||
|
||||
/**
|
||||
* Search for piggy banks.
|
||||
*
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function searchPiggyBank(string $query, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param int $piggyBankId
|
||||
*
|
||||
|
Reference in New Issue
Block a user