insertNumberRange example

$this->orderRepository->upsert([$order]$context);
        $order = $this->orderRepository->search(new Criteria([$orderId])$context);

        return $order->first();
    }

    private function insertRange(): void
    {
        $numberRangeId = Uuid::randomBytes();
        $numberRangeTypeId = Uuid::randomBytes();

        $this->insertNumberRange($this->connection, $numberRangeId$numberRangeTypeId);
        $this->insertTranslations($this->connection, $numberRangeId$numberRangeTypeId);
    }

    private function insertNumberRange(Connection $connection, string $numberRangeId, string $numberRangeTypeId): void
    {
        $connection->insert('number_range_type', [
            'id' => $numberRangeTypeId,
            'global' => 0,
            'technical_name' => 'document_example',
            'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
        ]);

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