|
3 | 3 |
|
4 | 4 | namespace Remp\MailerModule\Presenters;
|
5 | 5 |
|
6 |
| -use Remp\MailerModule\Repositories\BatchTemplatesRepository; |
| 6 | +use Remp\MailerModule\Models\Config\SearchConfig; |
7 | 7 | use Remp\MailerModule\Repositories\JobsRepository;
|
8 | 8 | use Remp\MailerModule\Repositories\LayoutsRepository;
|
9 | 9 | use Remp\MailerModule\Repositories\ListsRepository;
|
10 | 10 | use Remp\MailerModule\Repositories\TemplatesRepository;
|
11 | 11 |
|
12 | 12 | final class SearchPresenter extends BasePresenter
|
13 | 13 | {
|
14 |
| - private $templatesRepository; |
15 |
| - |
16 |
| - private $layoutsRepository; |
17 |
| - |
18 |
| - private $listsRepository; |
19 |
| - |
20 |
| - private $jobsRepository; |
21 |
| - |
22 | 14 | public function __construct(
|
23 |
| - TemplatesRepository $templatesRepository, |
24 |
| - LayoutsRepository $layoutsRepository, |
25 |
| - ListsRepository $listsRepository, |
26 |
| - JobsRepository $jobsRepository |
| 15 | + private TemplatesRepository $templatesRepository, |
| 16 | + private LayoutsRepository $layoutsRepository, |
| 17 | + private ListsRepository $listsRepository, |
| 18 | + private JobsRepository $jobsRepository, |
| 19 | + private SearchConfig $searchConfig, |
27 | 20 | ) {
|
28 | 21 | parent::__construct();
|
29 |
| - |
30 |
| - $this->templatesRepository = $templatesRepository; |
31 |
| - $this->layoutsRepository = $layoutsRepository; |
32 |
| - $this->listsRepository = $listsRepository; |
33 |
| - $this->jobsRepository = $jobsRepository; |
34 | 22 | }
|
35 | 23 |
|
36 | 24 | public function actionDefault($term): void
|
37 | 25 | {
|
38 |
| - $limit = (int) $this->environmentConfig->getParam('max_result_count', '5'); |
| 26 | + $limit = $this->searchConfig->getMaxResultCount(); |
39 | 27 | $layouts = array_values($this->layoutsRepository->search($term, $limit));
|
40 | 28 | $lists = array_values($this->listsRepository->search($term, $limit));
|
41 | 29 |
|
|
0 commit comments