Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddressBuilder.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
22  {
23  return [
24  'streetAddress' => $this->getStreetLine(1, $address->getStreet()),
25  'unit' => $this->getStreetLine(2, $address->getStreet()),
26  'city' => $address->getCity(),
27  'provinceCode' => $address->getRegionCode(),
28  'postalCode' => $address->getPostcode(),
29  'countryCode' => $address->getCountryId()
30  ];
31  }
32 
40  private function getStreetLine($number, $street)
41  {
42  $lines = is_array($street) ? $street : [];
43 
44  return isset($lines[$number - 1]) ? $lines[$number - 1] : '';
45  }
46 }
$number
Definition: details.phtml:22
$address
Definition: customer.php:38