From 6c0474afdea3c76118857cb69a7d7b019912b892 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Thu, 5 Dec 2024 12:05:28 +0100 Subject: [PATCH] Use dependency injection for `SearchRepository` --- Classes/Controller/SearchController.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index 4779597..c256319 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -27,6 +27,7 @@ use In2code\Femanager\Controller\AbstractController; use Slub\DigasFeManagement\Domain\Model\Search; +use Slub\DigasFeManagement\Domain\Repository\SearchRepository; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; @@ -37,12 +38,22 @@ class SearchController extends AbstractController { /** - * searchRepository + * @access protected + * @var SearchRepository + */ + protected SearchRepository $searchRepository; + + /** + * @access public + * + * @param SearchRepository $searchRepository * - * @var \Slub\DigasFeManagement\Domain\Repository\SearchRepository - * @TYPO3\CMS\Extbase\Annotation\Inject + * @return void */ - protected $searchRepository = null; + public function injectSearchRepository(SearchRepository $searchRepository): void + { + $this->searchRepository = $searchRepository; + } /** * action list