Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDeleteImageChildrenQuery example
return
;
}
$query
=
$this
->
getRepository
(
)
->
getArticleImageDataQuery
(
$imageId
)
;
$image
=
$query
->
getOneOrNullResult
(
AbstractQuery::HYDRATE_OBJECT
)
;
if
(
!
$image
instanceof Image
)
{
throw
new
ModelNotFoundException
(
Image::
class
,
$imageId
)
;
}
$imageData
=
$query
->
getOneOrNullResult
(
AbstractQuery::HYDRATE_ARRAY
)
;
$this
->
getRepository
(
)
->
getDeleteImageChildrenQuery
(
$imageId
)
->
execute
(
)
;
$mappingModels
=
[
]
;
foreach
(
$mappings
as
$mappingData
)
{
if
(
empty
(
$mappingData
[
'rules'
]
)
)
{
continue
;
}
if
(
empty
(
$mappingData
[
'id'
]
)
)
{
$mapping
=
new
Mapping
(
)
;
}
else
{
$mapping
=
$this
->
get
(
'models'
)
->
find
(
Mapping::
class
,
$mappingData
[
'id'
]
)
;
}