getCodeArray example

$promotion = $this->promotionRepository->search($criteria$context)->first();

        if ($promotion->getIndividualCodes() === null) {
            $this->replaceIndividualCodes($promotionId$promotion->getIndividualCodePattern()$amount$context);

            return;
        }

        $newCodes = $this->generateIndividualCodes(
            $promotion->getIndividualCodePattern(),
            $amount,
            $promotion->getIndividualCodes()->getCodeArray()
        );

        $codeEntries = $this->prepareCodeEntities($promotionId$newCodes);
        $this->individualCodesRepository->upsert($codeEntries$context);
    }

    /** * @throws PatternAlreadyInUseException */
    public function replaceIndividualCodes(string $promotionId, string $pattern, int $amount, Context $context): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.