ShippingTemplateUndeliveryEntity.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. namespace app\entity\data\shipping;
  3. use app\entity\data\DataEntity;
  4. class ShippingTemplateUndeliveryEntity extends DataEntity
  5. {
  6. public $shippingTemplateUndeliveryId = 0; // 编号
  7. public $tempId = 0; // 模板ID
  8. public $cityId = ''; // 城市ID /id/id/id/
  9. public $cityIdList = []; // 城市ID []
  10. /**
  11. * @return int
  12. */
  13. public function getShippingTemplateUndeliveryId(): int
  14. {
  15. return $this->shippingTemplateUndeliveryId;
  16. }
  17. /**
  18. * @param int $shippingTemplateUndeliveryId
  19. * @return ShippingTemplateUndeliveryEntity
  20. */
  21. public function setShippingTemplateUndeliveryId(int $shippingTemplateUndeliveryId): ShippingTemplateUndeliveryEntity
  22. {
  23. $this->shippingTemplateUndeliveryId = $shippingTemplateUndeliveryId;
  24. return $this;
  25. }
  26. /**
  27. * @return int
  28. */
  29. public function getTempId(): int
  30. {
  31. return $this->tempId;
  32. }
  33. /**
  34. * @param int $tempId
  35. * @return ShippingTemplateUndeliveryEntity
  36. */
  37. public function setTempId(int $tempId): ShippingTemplateUndeliveryEntity
  38. {
  39. $this->tempId = $tempId;
  40. return $this;
  41. }
  42. /**
  43. * @return string
  44. */
  45. public function getCityId(): string
  46. {
  47. return $this->cityId;
  48. }
  49. /**
  50. * @param string $cityId
  51. * @return ShippingTemplateUndeliveryEntity
  52. */
  53. public function setCityId(string $cityId): ShippingTemplateUndeliveryEntity
  54. {
  55. $this->cityId = $cityId;
  56. $cityIdList = explode("/", $this->cityId);
  57. $cityIdList = array_filter($cityIdList); // 删除空元素
  58. $cityIdList = array_values($cityIdList); // 重建数组索引
  59. $this->setCityIdList($cityIdList);
  60. return $this;
  61. }
  62. /**
  63. * @return array
  64. */
  65. public function getCityIdList(): array
  66. {
  67. return $this->cityIdList;
  68. }
  69. /**
  70. * @param array $cityIdList
  71. * @return ShippingTemplateUndeliveryEntity
  72. */
  73. public function setCityIdList(array $cityIdList): ShippingTemplateUndeliveryEntity
  74. {
  75. $this->cityIdList = $cityIdList;
  76. return $this;
  77. }
  78. }