Skip to content

Commit

Permalink
Use dependency injection for SearchRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Dec 5, 2024
1 parent 5987170 commit 6c0474a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit 6c0474a

Please sign in to comment.