Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Model
ResourceModel
Category
AggregateCount.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Catalog\Model\ResourceModel\Category
;
7
8
use
Magento\Catalog\Model\Category
;
9
13
class
AggregateCount
14
{
19
public
function
processDelete(
Category
$category
)
20
{
22
$resourceModel
=
$category
->getResource();
26
$parentIds =
$category
->getParentIds();
27
if
($parentIds) {
28
$childDecrease =
$category
->getChildrenCount() + 1;
29
// +1 is itself
30
$data
= [
'children_count'
=> new \Zend_Db_Expr(
'children_count - '
. $childDecrease)];
31
$where = [
'entity_id IN(?)'
=> $parentIds];
32
$resourceModel
->getConnection()->update(
$resourceModel
->getEntityTable(),
$data
, $where);
33
}
34
}
35
}
$category
$category
Definition:
catalog_category_with_slash.php:7
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Catalog\Model\Category
Definition:
Category.php:42
Magento\Catalog\Model\Category
Definition:
DataProviderTest.php:6
$resourceModel
$resourceModel
Definition:
tablerates.php:10
Magento\Catalog\Model\ResourceModel\Category
Definition:
CollectionTest.php:8
Magento\Catalog\Model\ResourceModel\Category\AggregateCount
Definition:
AggregateCount.php:13