Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
removeArticleEsd example
public
function
deleteAction
(
)
{
if
(
!
$this
->
Request
(
)
->
has
(
'id'
)
)
{
return
;
}
$id
=
(int)
$this
->
Request
(
)
->
getParam
(
'id'
)
;
$product
=
$this
->
getRepository
(
)
->
find
(
$id
)
;
if
(
!
$product
instanceof Product
)
{
return
;
}
$this
->
removePrices
(
$product
->
getId
(
)
)
;
$this
->
removeArticleEsd
(
$product
->
getId
(
)
)
;
$this
->
removeArticleDetails
(
$product
)
;
$this
->
removeArticleTranslations
(
$product
)
;
$this
->
get
(
'models'
)
->
remove
(
$product
)
;
$this
->
get
(
'models'
)
->
flush
(
)
;
$this
->
View
(
)
->
assign
(
[
'data' =>
$this
->
Request
(
)
->
getParams
(
)
,
'success' => true,
]
)
;
}