Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
removeOldAssignments example
$this
->
getCategoryComponent
(
)
->
removeCategoryAssignmentments
(
$categoryId
)
;
}
/** * @param int $categoryId */
public
function
backlogMoveCategory
(
$categoryId
)
{
$component
=
$this
->
getCategoryComponent
(
)
;
$component
->
rebuildCategoryPath
(
$categoryId
)
;
$component
->
removeOldAssignments
(
$categoryId
)
;
$component
->
rebuildAssignments
(
$categoryId
)
;
}
protected
function
addPendingAddAssignment
(
Article
$article
, Category
$category
)
{
$this
->pendingAddAssignments
[
$category
->
getId
(
)
. '_' .
$article
->
getId
(
)
]
=
[
'category' =>
$category
,
'article' =>
$article
,
]
;
}
public
function
removeOldAssignmentsAction
(
)
{
// Try to set maximum execution time @
set_time_limit
(
0
)
;
$categoryId
=
$this
->
Request
(
)
->
getParam
(
'categoryId'
)
;
$offset
=
$this
->
Request
(
)
->
getParam
(
'offset'
)
;
$count
=
$this
->
Request
(
)
->
getParam
(
'limit'
)
;
$this
->
getCategoryComponent
(
)
->
removeOldAssignments
(
$categoryId
,
$count
,
$offset
)
;
$this
->view->
assign
(
[
'success' => true,
]
)
;
}
public
function
getRebuildAssignmentsCountAction
(
)
{
$categoryId
=
$this
->
Request
(
)
->
getParam
(
'categoryId'
)
;
$count
=
$this
->
getCategoryComponent
(
)
->
rebuildAssignmentsCount
(
$categoryId
)
;