Skip to content

Commit

Permalink
refactor: use processImage function from rmnd_headless
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdmlln committed Feb 14, 2024
1 parent 5e4a78f commit 6acf898
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,20 @@
use ApacheSolrForTypo3\Solr\ViewHelpers\Document\HighlightResultViewHelper;
use ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet\RemoveAllFacetsViewHelper;
use ApacheSolrForTypo3\Solr\ViewHelpers\Uri\Facet\SetFacetItemViewHelper;
use FriendsOfTYPO3\Headless\Utility\FileUtility;
use Psr\Http\Message\ResponseInterface;
use Remind\Headless\Service\JsonService;
use Remind\Headless\Utility\ConfigUtility;
use Remind\HeadlessSolr\Event\ModifySearchDocumentEvent;
use TYPO3\CMS\Extbase\Service\ImageService;

class SearchController extends BaseSearchController
{
private ?FileUtility $fileUtility = null;
private ?JsonService $jsonService = null;
private ?ImageService $imageService = null;

public function injectFileUtility(FileUtility $fileUtility): void
{
$this->fileUtility = $fileUtility;
}

public function injectJsonService(JsonService $jsonService): void
{
$this->jsonService = $jsonService;
}

public function injectImageService(ImageService $imageService): void
{
$this->imageService = $imageService;
}

public function formAction(): ResponseInterface
{
parent::formAction();
Expand Down Expand Up @@ -114,8 +100,7 @@ public function resultsAction(): ResponseInterface
$imageJson = null;
$imageUid = $searchResult->__get('image_intS') ?? null;
if ($imageUid) {
$imageObj = $this->imageService->getImage(strval($imageUid), null, true);
$imageJson = $this->fileUtility->processFile($imageObj);
$imageJson = $this->jsonService->processImage($imageUid);
}

$document = [
Expand Down

0 comments on commit 6acf898

Please sign in to comment.