createOrSkipExistingStateMachineState example

class StateMachineMigrationImporter
{
    use ImportTranslationsTrait;

    public function __construct(private readonly Connection $connection)
    {
    }

    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
        );
Home | Imprint | This part of the site doesn't use cookies.