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
Product
ReservedAttributeList.php
Go to the documentation of this file.
1
<?php
9
namespace
Magento\Catalog\Model\Product
;
10
15
class
ReservedAttributeList
16
{
20
protected
$_reservedAttributes
;
21
27
public
function
__construct
(
$productModel
, array $reservedAttributes = [], array $allowedAttributes = [])
28
{
29
$methods
= get_class_methods(
$productModel
);
30
foreach
(
$methods
as
$method
) {
31
if
(preg_match(
'/^get([A-Z]{1}.+)/'
,
$method
, $matches)) {
32
$method
= $matches[1];
33
$tmp = strtolower(preg_replace(
'/(.)([A-Z])/'
,
"$1_$2"
,
$method
));
34
$reservedAttributes[] = $tmp;
35
}
36
}
37
$this->_reservedAttributes = array_diff($reservedAttributes, $allowedAttributes);
38
}
39
46
public
function
isReservedAttribute
(
$attribute
)
47
{
48
return
$attribute
->getIsUserDefined() && in_array(
$attribute
->getAttributeCode(),
$this->_reservedAttributes
);
49
}
50
}
Magento\Catalog\Model\Product\ReservedAttributeList\isReservedAttribute
isReservedAttribute($attribute)
Definition:
ReservedAttributeList.php:46
Magento\Catalog\Model\Product\ReservedAttributeList
Definition:
ReservedAttributeList.php:15
$attribute
$attribute
Definition:
attribute_set_with_image_attribute.php:41
Magento\Catalog\Model\Product\ReservedAttributeList\__construct
__construct($productModel, array $reservedAttributes=[], array $allowedAttributes=[])
Definition:
ReservedAttributeList.php:27
$methods
$methods
Definition:
billing.phtml:71
Magento\Catalog\Model\Product
Definition:
ActionTest.php:6
$method
$method
Definition:
info.phtml:13
Magento\Catalog\Model\Product\ReservedAttributeList\$_reservedAttributes
$_reservedAttributes
Definition:
ReservedAttributeList.php:20
$productModel
$productModel
Definition:
create_products.php:7