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
CustomerData
Customer.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\CustomerData
;
8
9
use
Magento\Customer\Helper\Session\CurrentCustomer
;
10
use
Magento\Customer\Helper\View
;
11
15
class
Customer
implements
SectionSourceInterface
16
{
20
protected
$currentCustomer
;
21
25
private
$customerViewHelper;
26
31
public
function
__construct
(
32
CurrentCustomer
$currentCustomer
,
33
View
$customerViewHelper
34
) {
35
$this->currentCustomer =
$currentCustomer
;
36
$this->customerViewHelper = $customerViewHelper;
37
}
38
42
public
function
getSectionData
()
43
{
44
if
(!$this->currentCustomer->getCustomerId()) {
45
return
[];
46
}
47
48
$customer
= $this->currentCustomer->getCustomer();
49
return
[
50
'fullname'
=> $this->customerViewHelper->getCustomerName(
$customer
),
51
'firstname'
=>
$customer
->getFirstname(),
52
'websiteId'
=>
$customer
->getWebsiteId(),
53
];
54
}
55
}
Magento\Customer\Helper\Session\CurrentCustomer
Definition:
CurrentCustomer.php:19
Magento\Customer\CustomerData\Customer\$currentCustomer
$currentCustomer
Definition:
Customer.php:20
Magento\Customer\CustomerData
Definition:
Customer.php:7
Magento\Customer\CustomerData\Customer\getSectionData
getSectionData()
Definition:
Customer.php:42
$customer
$customer
Definition:
customers.php:11
Magento\Customer\CustomerData\SectionSourceInterface
Definition:
SectionSourceInterface.php:14
Magento\Customer\CustomerData\Customer\__construct
__construct(CurrentCustomer $currentCustomer, View $customerViewHelper)
Definition:
Customer.php:31
Magento\Customer\Helper\View
Definition:
View.php:15
Magento\Customer\CustomerData\Customer
Definition:
Customer.php:15