From 2889f5690b049e54ff9e1ec6553d5093d697922e Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Thu, 22 Aug 2024 13:48:43 +0200 Subject: [PATCH 1/2] Controller can be extended and used --- src/Controller/SearchController.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index a3f4f4d..c51722e 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -35,19 +35,19 @@ class SearchController extends AbstractController { - private Search $search; + protected Search $search; - private CurrencyContextInterface $currencyContext; + protected CurrencyContextInterface $currencyContext; - private LocaleContextInterface $localeContext; + protected LocaleContextInterface $localeContext; - private ChannelContextInterface $channelContext; + protected ChannelContextInterface $channelContext; - private SettingsInterface $searchSettings; + protected SettingsInterface $searchSettings; - private ServiceRegistryInterface $documentableRegistry; + protected ServiceRegistryInterface $documentableRegistry; - private ParametersParserInterface $parametersParser; + protected ParametersParserInterface $parametersParser; public function __construct( Search $search, @@ -162,7 +162,7 @@ public function taxonAction( ]); } - private function getDocumentable(?string $documentType): DocumentableInterface + protected function getDocumentable(?string $documentType): DocumentableInterface { if (null === $documentType) { $documentables = $this->getSearchEnabledDocumentables(); @@ -178,14 +178,14 @@ private function getDocumentable(?string $documentType): DocumentableInterface } } - private function getSearchEnabledDocumentables(): array + protected function getSearchEnabledDocumentables(): array { return array_filter($this->documentableRegistry->all(), function (DocumentableInterface $documentable) { return (bool) $this->searchSettings->getCurrentValue($this->channelContext->getChannel(), null, 'search_enabled__' . $documentable->getIndexCode()); }); } - private function getInstantSearchEnabledDocumentables(): array + protected function getInstantSearchEnabledDocumentables(): array { return array_filter($this->documentableRegistry->all(), function (DocumentableInterface $documentable) { return (bool) $this->searchSettings->getCurrentValue($this->channelContext->getChannel(), null, 'instant_search_enabled__' . $documentable->getIndexCode()); From cb3f6e3ddd0f653f6052353a671b191b571ec7eb Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Thu, 22 Aug 2024 13:49:10 +0200 Subject: [PATCH 2/2] Rename docker-compose to docker compose --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3e29f07..2dc9c5c 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ export COMPOSE_PROJECT_NAME=search export MIGRATIONS_NAMESPACE=MonsieurBiz\\SyliusSearchPlugin\\Migrations export USER_UID=$(shell id -u) PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin -COMPOSE=docker-compose +COMPOSE=docker compose YARN=yarn ###