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-search
Model
Attribute
SearchWeight.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CatalogSearch\Model\Attribute
;
8
16
class
SearchWeight
17
{
21
public
function
__construct
(
22
\
Magento
\Framework\Search\Request\
Config
$config
23
) {
24
$this->config =
$config
;
25
}
26
49
public
function
aroundSave
(
50
\
Magento
\Catalog\Model\
ResourceModel
\
Attribute
$subject,
51
\Closure $proceed,
52
\
Magento
\Framework\Model\AbstractModel
$attribute
53
) {
54
$isNew =
$attribute
->isObjectNew();
55
$isWeightChanged =
$attribute
->dataHasChangedFor(
'search_weight'
);
56
57
$result
= $proceed(
$attribute
);
58
if
($isNew || $isWeightChanged) {
59
$this->config->reset();
60
}
61
62
return
$result
;
63
}
64
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$config
$config
Definition:
fraud_order.php:17
$attribute
$attribute
Definition:
attribute_set_with_image_attribute.php:41
Magento\CatalogSearch\Model\Attribute\SearchWeight\aroundSave
aroundSave(\Magento\Catalog\Model\ResourceModel\Attribute $subject, \Closure $proceed, \Magento\Framework\Model\AbstractModel $attribute)
Definition:
SearchWeight.php:49
Magento\CatalogSearch\Model\Attribute
Definition:
SearchWeight.php:7
Magento\CatalogSearch\Model\Attribute\SearchWeight\__construct
__construct(\Magento\Framework\Search\Request\Config $config)
Definition:
SearchWeight.php:21
Magento
Magento\CatalogSearch\Model\Attribute\SearchWeight
Definition:
SearchWeight.php:16
Magento\Catalog\Model\ResourceModel\Eav\Attribute
Definition:
Attribute.php:31
Magento\Catalog\Model\Config
Definition:
Config.php:16