Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
NoResultException example
$this
->mediaService =
$mediaService
;
}
/** * {@inheritdoc} */
public
function
load
(
$presetId
)
{
$preset
=
$this
->modelManager->
getRepository
(
Preset::
class
)
->
find
(
$presetId
)
;
if
(
!
$preset
)
{
throw
new
NoResultException
(
)
;
}
$presetData
=
json_decode
(
$preset
->
getPresetData
(
)
, true
)
;
if
(
empty
(
$presetData
[
'elements'
]
)
)
{
return
$preset
->
getPresetData
(
)
;
}
$presetData
[
'elements'
]
=
$this
->
refreshElementData
(
$presetData
[
'elements'
]
)
;
$preset
->
setPresetData
(
json_encode
(
$presetData
)
)
;