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-customer
Block
DataProviders
AddressAttributeData.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Customer\Block\DataProviders
;
9
10
use
Magento\Framework\Escaper
;
11
use
Magento\Framework\View\Element\Block\ArgumentInterface
;
12
use
Magento\Customer\Api\AddressMetadataInterface
;
13
use
Magento\Framework\Exception\LocalizedException
;
14
use
Magento\Framework\Exception\NoSuchEntityException
;
15
19
class
AddressAttributeData
implements
ArgumentInterface
20
{
24
private
$addressMetadata;
25
29
private
$escaper;
30
35
public
function
__construct
(
36
AddressMetadataInterface
$addressMetadata,
37
Escaper
$escaper
38
) {
39
40
$this->addressMetadata = $addressMetadata;
41
$this->escaper = $escaper;
42
}
43
51
public
function
getFrontendLabel
(
string
$attributeCode
): string
52
{
53
try
{
54
$attribute
= $this->addressMetadata->getAttributeMetadata(
$attributeCode
);
55
$frontendLabel =
$attribute
->getFrontendLabel();
56
}
catch
(
NoSuchEntityException
$e) {
57
$frontendLabel =
''
;
58
}
59
60
return
$this->escaper->escapeHtml(
__
($frontendLabel));
61
}
62
}
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
$attribute
$attribute
Definition:
attribute_set_with_image_attribute.php:41
Magento\Framework\View\Element\Block\ArgumentInterface
Definition:
ArgumentInterface.php:15
__
__()
Definition:
__.php:13
Magento\Customer\Block\DataProviders\AddressAttributeData\getFrontendLabel
getFrontendLabel(string $attributeCode)
Definition:
AddressAttributeData.php:51
Magento\Customer\Block\DataProviders
Definition:
AddressAttributeData.php:8
Magento\Framework\Escaper
Definition:
Escaper.php:15
Magento\Customer\Api\AddressMetadataInterface
Definition:
AddressMetadataInterface.php:14
$attributeCode
$attributeCode
Definition:
extend.phtml:12
Magento\Customer\Block\DataProviders\AddressAttributeData\__construct
__construct(AddressMetadataInterface $addressMetadata, Escaper $escaper)
Definition:
AddressAttributeData.php:35
Magento\Customer\Block\DataProviders\AddressAttributeData
Definition:
AddressAttributeData.php:19
Magento\Framework\Exception\NoSuchEntityException
Definition:
NoSuchEntityException.php:16