insertTranslations example

'id' => Uuid::fromHexToBytes($stateId),
                    'technical_name' => 'unconfirmed',
                    'state_machine_id' => Uuid::fromHexToBytes($machineId),
                    'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
                ]
            );
        } catch (UniqueConstraintViolationException) {
            // don't add state if it already exists             return;
        }

        $this->insertTranslations($stateId$connection);

        // from         $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'open')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'reminded')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'failed')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'cancelled')$stateId$connection);
        $this->insertTransition('process_unconfirmed', $machineId$this->getStateId($connection$machineId, 'paid_partially')$stateId$connection);

        // to         $this->insertTransition('paid', $machineId$stateId$this->getStateId($connection$machineId, 'paid')$connection);
        $this->insertTransition('paid_partially', $machineId$stateId$this->getStateId($connection$machineId, 'paid_partially')$connection);
        
$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.