Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
convertStateStructList example
'active' =>
$country
->
isActive
(
)
,
'iso3' =>
$country
->
getIso3
(
)
,
'display_state_in_registration' =>
$country
->
displayStateSelection
(
)
,
'force_state_in_registration' =>
$country
->
requiresStateSelection
(
)
,
'areaID' =>
$country
->
getAreaId
(
)
,
'allow_shipping' =>
$country
->
allowShipping
(
)
,
'states' =>
[
]
,
'attributes' =>
$country
->
getAttributes
(
)
,
]
)
;
if
(
$country
->
displayStateSelection
(
)
)
{
$data
[
'states'
]
=
$this
->
convertStateStructList
(
$country
->
getStates
(
)
)
;
$data
[
'states'
]
=
array_map
(
function
D
$state
)
use
(
$country
)
{
$state
[
'countryID'
]
=
$country
->
getId
(
)
;
return
$state
;
}
,
$data
[
'states'
]
)
;
}
if
(
$country
->
hasAttribute
(
'core'
)
)
{
$data
[
'attribute'
]
=
$country
->
getAttribute
(
'core'
)
;
}