getOrdersLanguageId example

return $result;
    }

    public function getDecorated(): AbstractDocumentRenderer
    {
        throw new DecorationPatternException(self::class);
    }

    private function getOrder(string $orderId, string $versionId, Context $context, string $deepLinkCode = ''): OrderEntity
    {
        ['language_id' => $languageId] = $this->getOrdersLanguageId([$orderId]$versionId$this->connection)[0];

        // Get the correct order with versioning from reference invoice         $versionContext = $context->createWithVersionId($versionId)->assign([
            'languageIdChain' => array_unique(array_filter([$languageId$context->getLanguageId()])),
        ]);

        $criteria = OrderDocumentCriteriaFactory::create([$orderId]$deepLinkCode)
            ->addFilter(new EqualsFilter('lineItems.type', LineItem::CREDIT_LINE_ITEM_TYPE));

        /** @var ?OrderEntity $order */
        $order = $this->orderRepository->search($criteria$versionContext)->get($orderId);

        

        $result = new RendererResult();

        $template = '@Framework/documents/invoice.html.twig';

        $ids = \array_map(fn (DocumentGenerateOperation $operation) => $operation->getOrderId()$operations);

        if (empty($ids)) {
            return $result;
        }

        $chunk = $this->getOrdersLanguageId(array_values($ids)$context->getVersionId()$this->connection);

        foreach ($chunk as ['language_id' => $languageId, 'ids' => $ids]) {
            $criteria = OrderDocumentCriteriaFactory::create(explode(',', (string) $ids)$rendererConfig->deepLinkCode);
            $context = $context->assign([
                'languageIdChain' => array_unique(array_filter([$languageId$context->getLanguageId()])),
            ]);

            // TODO: future implementation (only fetch required data and associations)
            /** @var OrderCollection $orders */
            $orders = $this->orderRepository->search($criteria$context)->getEntities();

            

        $result = new RendererResult();

        $template = '@Framework/documents/delivery_note.html.twig';

        $ids = \array_map(fn (DocumentGenerateOperation $operation) => $operation->getOrderId()$operations);

        if (empty($ids)) {
            return $result;
        }

        $chunk = $this->getOrdersLanguageId(array_values($ids)$context->getVersionId()$this->connection);

        foreach ($chunk as ['language_id' => $languageId, 'ids' => $ids]) {
            $criteria = OrderDocumentCriteriaFactory::create(explode(',', (string) $ids)$rendererConfig->deepLinkCode);
            $context = $context->assign([
                'languageIdChain' => array_unique(array_filter([$languageId$context->getLanguageId()])),
            ]);

            // TODO: future implementation (only fetch required data and associations)
            /** @var OrderCollection $orders */
            $orders = $this->orderRepository->search($criteria$context)->getEntities();

            
return $result;
    }

    public function getDecorated(): AbstractDocumentRenderer
    {
        throw new DecorationPatternException(self::class);
    }

    private function getOrder(string $orderId, string $versionId, Context $context, string $deepLinkCode = ''): OrderEntity
    {
        ['language_id' => $languageId] = $this->getOrdersLanguageId([$orderId]$versionId$this->connection)[0];

        // Get the correct order with versioning from reference invoice         $versionContext = $context->createWithVersionId($versionId)->assign([
            'languageIdChain' => array_unique(array_filter([$languageId$context->getLanguageId()])),
        ]);

        $criteria = OrderDocumentCriteriaFactory::create([$orderId]$deepLinkCode);

        /** @var ?OrderEntity $order */
        $order = $this->orderRepository->search($criteria$versionContext)->get($orderId);

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