Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDe 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
{
$id
=
$this
->connection->
fetchOne
(
' SELECT `id` FROM `state_machine` WHERE technical_name = :technicalName ',