sortLanguages example


    public function update(array $ids, Context $context): void
    {
        if (empty($ids)) {
            return;
        }

        $criteria = new Criteria();
        $criteria->addFilter(new NandFilter([new EqualsFilter('salesChannels.id', null)]));
        $languages = $this->languageRepository->search($criteria, Context::createDefaultContext())->getEntities();

        $languages = $this->sortLanguages($languages);

        $products = [];
        foreach ($languages as $language) {
            $languageContext = new Context(
                new SystemSource(),
                [],
                Defaults::CURRENCY,
                array_filter([$language->getId()$language->getParentId(), Defaults::LANGUAGE_SYSTEM]),
                $context->getVersionId()
            );

            
Home | Imprint | This part of the site doesn't use cookies.