Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Customer.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
20  protected $currentCustomer;
21 
25  private $customerViewHelper;
26 
31  public function __construct(
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 }
$customer
Definition: customers.php:11
__construct(CurrentCustomer $currentCustomer, View $customerViewHelper)
Definition: Customer.php:31