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-eav
Block
Adminhtml
Attribute
PropertyLocker.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Eav\Block\Adminhtml\Attribute
;
7
8
use
Magento\Framework\Registry
;
9
use
Magento\Eav\Model\Entity\Attribute\Config
;
10
16
class
PropertyLocker
17
{
21
private
$attributeConfig;
22
26
protected
$registry
;
27
33
public
function
__construct
(
34
Registry
$registry
,
35
Config
$attributeConfig
36
) {
37
$this->registry =
$registry
;
38
$this->attributeConfig = $attributeConfig;
39
}
40
45
public
function
lock(\
Magento
\Framework\Data\Form $form)
46
{
48
$attributeObject = $this->registry->registry(
'entity_attribute'
);
49
if
($attributeObject->getId()) {
50
foreach
($this->attributeConfig->getLockedFields($attributeObject) as $field) {
51
if
(
$element
= $form->getElement($field)) {
52
$element
->setDisabled(1);
53
$element
->setReadonly(1);
54
}
55
}
56
}
57
}
58
}
Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker
Definition:
PropertyLocker.php:16
Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker\__construct
__construct(Registry $registry, Config $attributeConfig)
Definition:
PropertyLocker.php:33
Magento\Eav\Model\Entity\Attribute\Config
Definition:
Config.php:16
Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker\$registry
$registry
Definition:
PropertyLocker.php:26
Magento
Magento\Framework\Registry
Definition:
Registry.php:18
Magento\Eav\Block\Adminhtml\Attribute
Magento\Eav\Model\Entity\Attribute\Config
Definition:
Converter.php:8
$element
$element
Definition:
element.phtml:12