StateMachineMigration example


    }

    public function importStateMachine(StateMachineMigration $stateMachineMigration): StateMachineMigration
    {
        $stateMachineId = $this->createOrSkipExistingStateMachine($stateMachineMigration);
        $states = $this->createOrSkipExistingStateMachineState($stateMachineMigration$stateMachineId);
        $transitions = $this->createOrSkipExistingStateMachineStateTransitions($stateMachineMigration$stateMachineId);

        $initialStateId = $this->updateInitialState($stateMachineMigration$stateMachineId);

        return new StateMachineMigration(
            $stateMachineMigration->getTechnicalName(),
            $stateMachineMigration->getDe(),
            $stateMachineMigration->getEn(),
            $states,
            $transitions,
            $initialStateId
        );
    }

    private function createOrSkipExistingStateMachine(StateMachineMigration $stateMachineMigration): string
    {
        

        $this->import($this->captureStateMachine()$connection);
        $this->import($this->captureRefundStateMachine()$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
    }

    private function captureStateMachine(): StateMachineMigration
    {
        return new StateMachineMigration(
            OrderTransactionCaptureStates::STATE_MACHINE,
            'Bezahlstatus',
            'Capture state',
            [
                StateMachineMigration::state(
                    OrderTransactionCaptureStates::STATE_PENDING,
                    'Ausstehend',
                    'Pending'
                ),
                StateMachineMigration::state(
                    OrderTransactionCaptureStates::STATE_COMPLETED,
                    
Home | Imprint | This part of the site doesn't use cookies.