Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
updateInitialState example
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
)
;
}