Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Customer Class Reference
Inheritance diagram for Customer:
SectionSourceInterface

Public Member Functions

 __construct (CurrentCustomer $currentCustomer, View $customerViewHelper)
 
 getSectionData ()
 

Protected Attributes

 $currentCustomer
 

Detailed Description

Customer section

Definition at line 15 of file Customer.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( CurrentCustomer  $currentCustomer,
View  $customerViewHelper 
)
Parameters
CurrentCustomer$currentCustomer
View$customerViewHelper

Definition at line 31 of file Customer.php.

34  {
35  $this->currentCustomer = $currentCustomer;
36  $this->customerViewHelper = $customerViewHelper;
37  }

Member Function Documentation

◆ getSectionData()

getSectionData ( )

{Get data

Returns
array
}

Implements SectionSourceInterface.

Definition at line 42 of file Customer.php.

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  }
$customer
Definition: customers.php:11

Field Documentation

◆ $currentCustomer

$currentCustomer
protected

Definition at line 20 of file Customer.php.


The documentation for this class was generated from the following file: