FakeRegion.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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\Data;
  9. use Magento\TestModuleExtensionAttributes\Api\Data\FakeRegionInterface;
  10. use Magento\Framework\Api\AbstractExtensibleObject;
  11. class FakeRegion extends AbstractExtensibleObject implements FakeRegionInterface
  12. {
  13. /**
  14. * Get region
  15. *
  16. * @return string
  17. */
  18. public function getRegion()
  19. {
  20. return $this->_get(self::REGION);
  21. }
  22. /**
  23. * Get region code
  24. *
  25. * @return string
  26. */
  27. public function getRegionCode()
  28. {
  29. return $this->_get(self::REGION_CODE);
  30. }
  31. /**
  32. * Get region id
  33. *
  34. * @return int
  35. */
  36. public function getRegionId()
  37. {
  38. return $this->_get(self::REGION_ID);
  39. }
  40. /**
  41. * {@inheritdoc}
  42. *
  43. * @return \Magento\TestModuleExtensionAttributes\Api\Data\FakeRegionExtensionInterface|null
  44. */
  45. public function getExtensionAttributes()
  46. {
  47. return $this->_getExtensionAttributes();
  48. }
  49. /**
  50. * {@inheritdoc}
  51. *
  52. * @param \Magento\TestModuleExtensionAttributes\Api\Data\FakeRegionExtensionInterface $extensionAttributes
  53. * @return $this
  54. */
  55. public function setExtensionAttributes(
  56. \Magento\TestModuleExtensionAttributes\Api\Data\FakeRegionExtensionInterface $extensionAttributes
  57. ) {
  58. return $this->_setExtensionAttributes($extensionAttributes);
  59. }
  60. /**
  61. * Set region code
  62. *
  63. * @param string $regionCode
  64. * @return $this
  65. */
  66. public function setRegionCode($regionCode)
  67. {
  68. return $this->setData(self::REGION_CODE, $regionCode);
  69. }
  70. }