-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
As a part of improving performance and Developer Experience, Magento should reduce the use of around
plugins. The ticket mentions some of these, as a "TODO" list to handle in near future.
magento2/app/code/Magento/Catalog/Model/Indexer/Product/Price/Plugin/CustomerGroup.php
Lines 81 to 95 in b7f6d64
public function aroundSave( | |
GroupRepositoryInterface $subject, | |
\Closure $proceed, | |
GroupInterface $group | |
) { | |
$isGroupNew = $group->getId() === null; | |
$group = $proceed($group); | |
if ($isGroupNew) { | |
foreach ($this->getAffectedDimensions((string)$group->getId()) as $dimensions) { | |
$this->tableMaintainer->createTablesForDimensions($dimensions); | |
} | |
} | |
$this->updateIndex->update($group, $isGroupNew); | |
return $group; | |
} |
magento2/app/code/Magento/Theme/Model/Indexer/Design/Config/Plugin/Website.php
Lines 36 to 44 in e60d3a2
public function aroundSave(StoreWebsite $subject, \Closure $proceed) | |
{ | |
$isObjectNew = $subject->getId() == 0; | |
$result = $proceed(); | |
if ($isObjectNew) { | |
$this->indexerRegistry->get(Config::DESIGN_CONFIG_GRID_INDEXER_ID)->invalidate(); | |
} | |
return $result; | |
} |
magento2/app/code/Magento/Theme/Model/Indexer/Design/Config/Plugin/Store.php
Lines 36 to 44 in e60d3a2
public function aroundSave(StoreStore $subject, \Closure $proceed) | |
{ | |
$isObjectNew = $subject->getId() == 0; | |
$result = $proceed(); | |
if ($isObjectNew) { | |
$this->indexerRegistry->get(Config::DESIGN_CONFIG_GRID_INDEXER_ID)->invalidate(); | |
} | |
return $result; | |
} |
public function aroundSave( | |
\Magento\Catalog\Model\ResourceModel\Attribute $subject, | |
\Closure $proceed, | |
\Magento\Framework\Model\AbstractModel $attribute | |
) { | |
$isNew = $attribute->isObjectNew(); | |
$isWeightChanged = $attribute->dataHasChangedFor('search_weight'); | |
$result = $proceed($attribute); | |
if ($isNew || $isWeightChanged) { | |
$this->config->reset(); | |
} | |
return $result; | |
} |
magento2/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Remove.php
Lines 61 to 73 in e60d3a2
public function aroundDelete( | |
\Magento\Catalog\Model\ResourceModel\Category $subject, | |
\Closure $proceed, | |
\Magento\Catalog\Api\Data\CategoryInterface $category | |
) { | |
$categoryIds = $this->childrenCategoriesProvider->getChildrenIds($category, true); | |
$categoryIds[] = $category->getId(); | |
$result = $proceed($category); | |
foreach ($categoryIds as $categoryId) { | |
$this->deleteRewritesForCategory($categoryId); | |
} | |
return $result; | |
} |
magento2/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Product.php
Lines 66 to 76 in e6bbe78
public function aroundDelete( | |
\Magento\Catalog\Model\ResourceModel\Product $subject, | |
\Closure $proceed, | |
\Magento\Catalog\Model\Product $product | |
) { | |
$configurableProductIds = $this->configurable->getParentIdsByChild($product->getId()); | |
$result = $proceed($product); | |
$this->productIndexer->executeList($configurableProductIds); | |
return $result; | |
} |
Summary (*)
Examples (*)
Proposed solution
Metadata
Metadata
Assignees
Labels
Type
Projects
Status