ShippingTemplateFreeEntity.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. namespace app\entity\data\shipping;
  3. use app\entity\data\DataEntity;
  4. class ShippingTemplateFreeEntity extends DataEntity
  5. {
  6. public $shippingTemplateFreeId = 0; // 编号
  7. public $tempId = 0; // 模板ID
  8. public $cityId = ''; // 城市ID /id/id/id/id/
  9. public $cityIdList = []; // 城市ID []
  10. public $number = 0; // 包邮件数
  11. public $price = 0.00; // 包邮金额
  12. /**
  13. * @return int
  14. */
  15. public function getShippingTemplateFreeId(): int
  16. {
  17. return $this->shippingTemplateFreeId;
  18. }
  19. /**
  20. * @param int $shippingTemplateFreeId
  21. * @return ShippingTemplateFreeEntity
  22. */
  23. public function setShippingTemplateFreeId(int $shippingTemplateFreeId): ShippingTemplateFreeEntity
  24. {
  25. $this->shippingTemplateFreeId = $shippingTemplateFreeId;
  26. return $this;
  27. }
  28. /**
  29. * @return int
  30. */
  31. public function getTempId(): int
  32. {
  33. return $this->tempId;
  34. }
  35. /**
  36. * @param int $tempId
  37. * @return ShippingTemplateFreeEntity
  38. */
  39. public function setTempId(int $tempId): ShippingTemplateFreeEntity
  40. {
  41. $this->tempId = $tempId;
  42. return $this;
  43. }
  44. /**
  45. * @return string
  46. */
  47. public function getCityId(): string
  48. {
  49. return $this->cityId;
  50. }
  51. /**
  52. * @param string $cityId
  53. * @return ShippingTemplateFreeEntity
  54. */
  55. public function setCityId(string $cityId): ShippingTemplateFreeEntity
  56. {
  57. $this->cityId = $cityId;
  58. $cityIdList = explode("/", $this->cityId);
  59. $cityIdList = array_filter($cityIdList); // 删除空元素
  60. $cityIdList = array_values($cityIdList); // 重建数组索引
  61. $this->setCityIdList($cityIdList);
  62. return $this;
  63. }
  64. /**
  65. * @return array
  66. */
  67. public function getCityIdList(): array
  68. {
  69. return $this->cityIdList;
  70. }
  71. /**
  72. * @param array $cityIdList
  73. * @return ShippingTemplateFreeEntity
  74. */
  75. public function setCityIdList(array $cityIdList): ShippingTemplateFreeEntity
  76. {
  77. $this->cityIdList = $cityIdList;
  78. return $this;
  79. }
  80. /**
  81. * @return int
  82. */
  83. public function getNumber(): int
  84. {
  85. return $this->number;
  86. }
  87. /**
  88. * @param int $number
  89. * @return ShippingTemplateFreeEntity
  90. */
  91. public function setNumber(int $number): ShippingTemplateFreeEntity
  92. {
  93. $this->number = $number;
  94. return $this;
  95. }
  96. /**
  97. * @return float
  98. */
  99. public function getPrice(): float
  100. {
  101. return $this->price;
  102. }
  103. /**
  104. * @param float $price
  105. * @return ShippingTemplateFreeEntity
  106. */
  107. public function setPrice(float $price): ShippingTemplateFreeEntity
  108. {
  109. $this->price = $price;
  110. return $this;
  111. }
  112. }