Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getRemoveAttributesQuery example
$query
=
$this
->
getRepository
(
)
->
getRemovePricesQuery
(
$articleId
)
;
$query
->
execute
(
)
;
}
/** * Internal helper function to remove the product attributes quickly. * * @param int $articleDetailId */
protected
function
removeAttributes
(
$articleDetailId
)
{
$query
=
$this
->
getRepository
(
)
->
getRemoveAttributesQuery
(
$articleDetailId
)
;
$query
->
execute
(
)
;
}
/** * Internal helper function to remove the detail esd configuration quickly. * * @param int $articleId */
protected
function
removeArticleEsd
(
$articleId
)
{
$query
=
$this
->
getRepository
(
)
->
getRemoveESDQuery
(
$articleId
)
;
protected
function
removeArticleDetails
(
$article
)
{
$sql
= 'SELECT id FROM s_articles_details WHERE articleID = ? AND kind != 1';
foreach
(
Shopware
(
)
->
Db
(
)
->
fetchAll
(
$sql
,
[
$article
->
getId
(
)
]
)
as
$detail
)
{
$query
=
$this
->
getRepository
(
)
->
getRemoveAttributesQuery
(
$detail
[
'id'
]
)
;
$query
->
execute
(
)
;
$query
=
$this
->
getRepository
(
)
->
getRemoveImageQuery
(
$detail
[
'id'
]
)
;
$query
->
execute
(
)
;
$sql
= 'DELETE FROM s_article_configurator_option_relations WHERE article_id = ?';
$this
->
getManager
(
)
->
getConnection
(
)
->
executeQuery
(
$sql
,
[
$detail
[
'id'
]
]
)
;
$sql
= 'DELETE FROM s_articles_prices WHERE articledetailsID = ?';
$this
->
getManager
(
)
->
getConnection
(
)
->
executeQuery
(
$sql
,
[
$detail
[
'id'
]
]
)
;