diff --git a/src/Fixture/ChannelLocalesFixture.php b/src/Fixture/ChannelLocalesFixture.php new file mode 100644 index 00000000..2af3f263 --- /dev/null +++ b/src/Fixture/ChannelLocalesFixture.php @@ -0,0 +1,73 @@ +channelRepository = $channelRepository; + $this->localeRepository = $localeRepository; + $this->entityManager = $entityManager; + } + + public function getName(): string + { + return 'channel_locales'; + } + + public function load(array $options): void + { + $channels = $this->channelRepository->findAll(); + if (count($channels) === 0) { + return; + } + + /** @var LocaleInterface|null $additionalLocale */ + $additionalLocale = $this->localeRepository->findOneBy(['code' => self::ADDITIONAL_LOCALE_CODE]); + if ($additionalLocale === null) { + return; + } + + /** @var ChannelInterface $channel */ + foreach ($channels as $channel) { + $channel->addLocale($additionalLocale); + } + + $this->entityManager->flush(); + } + + protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void + { + + } +} diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index 2e9fd561..8719fa99 100644 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -13,3 +13,10 @@ liip_imagine: sylius_shop_product_large_thumbnail: filters: thumbnail: { size: [550, 412], mode: outbound } + +sylius_fixtures: + suites: + default: + fixtures: + channel_locales: + priority: 0 diff --git a/src/Resources/config/routing.yml b/src/Resources/config/routing.yml index be22e7c4..e89d10f3 100644 --- a/src/Resources/config/routing.yml +++ b/src/Resources/config/routing.yml @@ -1,3 +1,10 @@ +api_graphql_entrypoint: + path: /api/v2/graphql/{_locale} + defaults: + _controller: api_platform.graphql.action.entrypoint + _locale: '%locale%' + _graphql: true + sylius_shop_password_reset: path: /reset-password methods: [GET, POST] diff --git a/src/Resources/services/fixtures.xml b/src/Resources/services/fixtures.xml new file mode 100644 index 00000000..d5d3e494 --- /dev/null +++ b/src/Resources/services/fixtures.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + +