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
Indexer
Product
Eav
Plugin
AttributeSet
IndexableAttributeFilter.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Model\Indexer\Product\Eav\Plugin\AttributeSet
;
8
9
class
IndexableAttributeFilter
10
{
14
protected
$_attributeFactory
;
15
19
public
function
__construct
(\
Magento
\Catalog\Model\
ResourceModel
\
Eav
\AttributeFactory $attributeFactory)
20
{
21
$this->_attributeFactory = $attributeFactory;
22
}
23
30
public
function
filter(\
Magento
\
Eav
\Model\Entity\Attribute\Set $set)
31
{
32
$codes = [];
33
$catalogResource = $this->_attributeFactory->create();
34
$groups = $set->getGroups();
35
if
(is_array($groups)) {
36
foreach
($groups as
$group
) {
38
foreach
(
$group
->getAttributes() as
$attribute
) {
40
$catalogResource->load(
$attribute
->getId());
41
if
($catalogResource->isIndexable()) {
42
// Attribute requires to be cloned for new dataset to maintain attribute set changes
43
$attributeClone = clone
$attribute
;
44
$attributeClone->load(
$attribute
->getAttributeId());
45
$codes[] = $attributeClone->getAttributeCode();
46
unset($attributeClone);
47
}
48
}
49
}
50
}
51
return
$codes;
52
}
53
}
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Catalog\Model\Indexer\Product\Eav\Plugin\AttributeSet\IndexableAttributeFilter\__construct
__construct(\Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory $attributeFactory)
Definition:
IndexableAttributeFilter.php:19
$attribute
$attribute
Definition:
attribute_set_with_image_attribute.php:41
$group
$group
Definition:
sections.phtml:16
Magento\Catalog\Model\Indexer\Product\Eav\Plugin\AttributeSet\IndexableAttributeFilter\$_attributeFactory
$_attributeFactory
Definition:
IndexableAttributeFilter.php:14
Magento\Catalog\Model\Indexer\Product\Eav
Definition:
Eav.php:10
Magento
Magento\Catalog\Model\Indexer\Product\Eav\Plugin\AttributeSet\IndexableAttributeFilter
Definition:
IndexableAttributeFilter.php:9
Magento\Catalog\Model\Indexer\Product\Eav\Plugin\AttributeSet
Definition:
IndexableAttributeFilter.php:7