mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +00:00
Updated API code.
This commit is contained in:
@@ -565,4 +565,19 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
return implode(' ', $params);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function searchRule(string $query, int $limit): Collection
|
||||
{
|
||||
$search = $this->user->rules();
|
||||
if ('' !== $query) {
|
||||
$search->where('rules.title', 'LIKE', sprintf('%%%s%%', $query));
|
||||
}
|
||||
$search->orderBy('rules.order', 'ASC')
|
||||
->orderBy('rules.title', 'ASC');
|
||||
|
||||
return $search->take($limit)->get(['id','title','description']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user