FakeAddress.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. declare(strict_types=1);
  8. namespace Magento\TestModuleExtensionAttributes\Model;
  9. use Magento\Framework\Model\AbstractExtensibleModel;
  10. use Magento\TestModuleExtensionAttributes\Api\Data\FakeAddressInterface;
  11. class FakeAddress extends AbstractExtensibleModel implements FakeAddressInterface
  12. {
  13. /**
  14. * Get ID
  15. *
  16. * @return int|null
  17. */
  18. public function getId()
  19. {
  20. return $this->getData(self::ID);
  21. }
  22. /**
  23. * Get customer ID
  24. *
  25. * @return int|null
  26. */
  27. public function getCustomerId()
  28. {
  29. return $this->getData(self::CUSTOMER_ID);
  30. }
  31. /**
  32. * Get region
  33. *
  34. * @return \Magento\TestModuleExtensionAttributes\Api\Data\FakeRegionInterface|null
  35. */
  36. public function getRegion()
  37. {
  38. return $this->getData(self::REGION);
  39. }
  40. /**
  41. * Get region
  42. *
  43. * @return \Magento\TestModuleExtensionAttributes\Api\Data\FakeRegionInterface[]|null
  44. */
  45. public function getRegions()
  46. {
  47. return $this->getData(self::REGIONS);
  48. }
  49. /**
  50. * Two-letter country code in ISO_3166-2 format
  51. *
  52. * @return string|null
  53. */
  54. public function getCountryId()
  55. {
  56. return $this->getData(self::COUNTRY_ID);
  57. }
  58. /**
  59. * Get street
  60. *
  61. * @return string[]|null
  62. */
  63. public function getStreet()
  64. {
  65. return $this->getData(self::STREET);
  66. }
  67. /**
  68. * Get company
  69. *
  70. * @return string|null
  71. */
  72. public function getCompany()
  73. {
  74. return $this->getData(self::COMPANY);
  75. }
  76. /**
  77. * Get telephone number
  78. *
  79. * @return string|null
  80. */
  81. public function getTelephone()
  82. {
  83. return $this->getData(self::TELEPHONE);
  84. }
  85. /**
  86. * Get fax number
  87. *
  88. * @return string|null
  89. */
  90. public function getFax()
  91. {
  92. return $this->getData(self::FAX);
  93. }
  94. /**
  95. * Get postcode
  96. *
  97. * @return string|null
  98. */
  99. public function getPostcode()
  100. {
  101. return $this->getData(self::POSTCODE);
  102. }
  103. /**
  104. * Get city name
  105. *
  106. * @return string|null
  107. */
  108. public function getCity()
  109. {
  110. return $this->getData(self::CITY);
  111. }
  112. /**
  113. * Get first name
  114. *
  115. * @return string|null
  116. */
  117. public function getFirstname()
  118. {
  119. return $this->getData(self::FIRSTNAME);
  120. }
  121. /**
  122. * Get last name
  123. *
  124. * @return string|null
  125. */
  126. public function getLastname()
  127. {
  128. return $this->getData(self::LASTNAME);
  129. }
  130. /**
  131. * Get middle name
  132. *
  133. * @return string|null
  134. */
  135. public function getMiddlename()
  136. {
  137. return $this->getData(self::MIDDLENAME);
  138. }
  139. /**
  140. * Get prefix
  141. *
  142. * @return string|null
  143. */
  144. public function getPrefix()
  145. {
  146. return $this->getData(self::PREFIX);
  147. }
  148. /**
  149. * Get suffix
  150. *
  151. * @return string|null
  152. */
  153. public function getSuffix()
  154. {
  155. return $this->getData(self::SUFFIX);
  156. }
  157. /**
  158. * Get Vat id
  159. *
  160. * @return string|null
  161. */
  162. public function getVatId()
  163. {
  164. return $this->getData(self::VAT_ID);
  165. }
  166. /**
  167. * Get if this address is default shipping address.
  168. *
  169. * @return bool|null
  170. */
  171. public function isDefaultShipping()
  172. {
  173. return $this->getData(self::DEFAULT_SHIPPING);
  174. }
  175. /**
  176. * Get if this address is default billing address
  177. *
  178. * @return bool|null
  179. */
  180. public function isDefaultBilling()
  181. {
  182. return $this->getData(self::DEFAULT_BILLING);
  183. }
  184. /**
  185. * {@inheritdoc}
  186. *
  187. * @return \Magento\TestModuleExtensionAttributes\Api\Data\FakeAddressExtensionInterface|null
  188. */
  189. public function getExtensionAttributes()
  190. {
  191. return $this->_getExtensionAttributes();
  192. }
  193. /**
  194. * {@inheritdoc}
  195. *
  196. * @param \Magento\TestModuleExtensionAttributes\Api\Data\FakeAddressExtensionInterface $extensionAttributes
  197. * @return $this
  198. */
  199. public function setExtensionAttributes(
  200. \Magento\TestModuleExtensionAttributes\Api\Data\FakeAddressExtensionInterface $extensionAttributes
  201. ) {
  202. return $this->_setExtensionAttributes($extensionAttributes);
  203. }
  204. }