Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Address.php
Go to the documentation of this file.
1 <?php
9 
11 use \Magento\Framework\Api\AttributeValueFactory;
12 
22 {
26  protected $metadataService;
27 
34  public function __construct(
35  \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
38  $data = []
39  ) {
40  $this->metadataService = $metadataService;
41  parent::__construct($extensionFactory, $attributeValueFactory, $data);
42  }
43 
47  protected function getCustomAttributesCodes()
48  {
49  if ($this->customAttributesCodes === null) {
50  $this->customAttributesCodes = $this->getEavAttributesCodes($this->metadataService);
51  }
53  }
54 
60  public function getId()
61  {
62  return $this->_get(self::ID);
63  }
64 
70  public function getRegion()
71  {
72  return $this->_get(self::REGION);
73  }
74 
80  public function getRegionId()
81  {
82  return $this->_get(self::REGION_ID);
83  }
84 
90  public function getCountryId()
91  {
92  return $this->_get(self::COUNTRY_ID);
93  }
94 
100  public function getStreet()
101  {
102  return $this->_get(self::STREET);
103  }
104 
110  public function getCompany()
111  {
112  return $this->_get(self::COMPANY);
113  }
114 
120  public function getTelephone()
121  {
122  return $this->_get(self::TELEPHONE);
123  }
124 
130  public function getFax()
131  {
132  return $this->_get(self::FAX);
133  }
134 
140  public function getPostcode()
141  {
142  return $this->_get(self::POSTCODE);
143  }
144 
150  public function getCity()
151  {
152  return $this->_get(self::CITY);
153  }
154 
160  public function getFirstname()
161  {
162  return $this->_get(self::FIRSTNAME);
163  }
164 
170  public function getLastname()
171  {
172  return $this->_get(self::LASTNAME);
173  }
174 
180  public function getMiddlename()
181  {
182  return $this->_get(self::MIDDLENAME);
183  }
184 
190  public function getPrefix()
191  {
192  return $this->_get(self::PREFIX);
193  }
194 
200  public function getSuffix()
201  {
202  return $this->_get(self::SUFFIX);
203  }
204 
210  public function getVatId()
211  {
212  return $this->_get(self::VAT_ID);
213  }
214 
220  public function getCustomerId()
221  {
222  return $this->_get(self::CUSTOMER_ID);
223  }
224 
230  public function isDefaultShipping()
231  {
232  return $this->_get(self::DEFAULT_SHIPPING);
233  }
234 
240  public function isDefaultBilling()
241  {
242  return $this->_get(self::DEFAULT_BILLING);
243  }
244 
251  public function setId($id)
252  {
253  return $this->setData(self::ID, $id);
254  }
255 
262  public function setCustomerId($customerId)
263  {
264  return $this->setData(self::CUSTOMER_ID, $customerId);
265  }
266 
273  public function setRegion(RegionInterface $region = null)
274  {
275  return $this->setData(self::REGION, $region);
276  }
277 
284  public function setRegionId($regionId)
285  {
286  return $this->setData(self::REGION_ID, $regionId);
287  }
288 
295  public function setCountryId($countryId)
296  {
297  return $this->setData(self::COUNTRY_ID, $countryId);
298  }
299 
306  public function setStreet(array $street)
307  {
308  return $this->setData(self::STREET, $street);
309  }
310 
317  public function setCompany($company)
318  {
319  return $this->setData(self::COMPANY, $company);
320  }
321 
328  public function setTelephone($telephone)
329  {
330  return $this->setData(self::TELEPHONE, $telephone);
331  }
332 
339  public function setFax($fax)
340  {
341  return $this->setData(self::FAX, $fax);
342  }
343 
350  public function setPostcode($postcode)
351  {
352  return $this->setData(self::POSTCODE, $postcode);
353  }
354 
361  public function setCity($city)
362  {
363  return $this->setData(self::CITY, $city);
364  }
365 
372  public function setFirstname($firstName)
373  {
374  return $this->setData(self::FIRSTNAME, $firstName);
375  }
376 
383  public function setLastname($lastName)
384  {
385  return $this->setData(self::LASTNAME, $lastName);
386  }
387 
394  public function setMiddlename($middleName)
395  {
396  return $this->setData(self::MIDDLENAME, $middleName);
397  }
398 
405  public function setPrefix($prefix)
406  {
407  return $this->setData(self::PREFIX, $prefix);
408  }
409 
416  public function setSuffix($suffix)
417  {
418  return $this->setData(self::SUFFIX, $suffix);
419  }
420 
427  public function setVatId($vatId)
428  {
429  return $this->setData(self::VAT_ID, $vatId);
430  }
431 
438  public function setIsDefaultShipping($isDefaultShipping)
439  {
440  return $this->setData(self::DEFAULT_SHIPPING, $isDefaultShipping);
441  }
442 
449  public function setIsDefaultBilling($isDefaultBilling)
450  {
451  return $this->setData(self::DEFAULT_BILLING, $isDefaultBilling);
452  }
453 
459  public function getExtensionAttributes()
460  {
461  return $this->_getExtensionAttributes();
462  }
463 
470  public function setExtensionAttributes(\Magento\Customer\Api\Data\AddressExtensionInterface $extensionAttributes)
471  {
472  return $this->_setExtensionAttributes($extensionAttributes);
473  }
474 }
setIsDefaultBilling($isDefaultBilling)
Definition: Address.php:449
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
$suffix
Definition: name.phtml:27
setRegion(RegionInterface $region=null)
Definition: Address.php:273
$id
Definition: fieldset.phtml:14
$prefix
Definition: name.phtml:25
$extensionAttributes
Definition: payment.php:22
setIsDefaultShipping($isDefaultShipping)
Definition: Address.php:438
__construct(\Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $attributeValueFactory, \Magento\Customer\Api\AddressMetadataInterface $metadataService, $data=[])
Definition: Address.php:34
setExtensionAttributes(\Magento\Customer\Api\Data\AddressExtensionInterface $extensionAttributes)
Definition: Address.php:470