Skip to content

Commit

Permalink
Merge pull request #51 from beatrycze-volk/fix-searchrepository-injec…
Browse files Browse the repository at this point in the history
…tion

[BUGFIX] Use dependency injection for `SearchRepository`
  • Loading branch information
beatrycze-volk authored Dec 5, 2024
2 parents 1338431 + 6c0474a commit bd6a408
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 bd6a408

Please sign in to comment.