Game.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * Game.php UTF-8
  4. * 游戏请求参数
  5. *
  6. * @date : 2018/1/19 15:21
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huo\controller\request;
  13. class Game {
  14. private $pkg_name = ''; /* 游戏包名 */
  15. private $app_ver = ''; /* 游戏版本 */
  16. private $h_ver = 0; /* 聚合SDK版本编号 */
  17. private $sdk_ver = ''; /* 客户端渠道SDK版本编号 */
  18. private $h_app_id = 0; /* 游戏ID */
  19. private $apple_id = '';/* 苹果ID */
  20. private $mp_id = '';/* 小程序ID */
  21. private $vb_id = '';/* 马甲包ID */
  22. public function __construct($data = []) {
  23. if (!empty($data)) {
  24. $this->setData($data);
  25. }
  26. }
  27. /**
  28. * 设置数据
  29. *
  30. * @param array $data
  31. */
  32. public function setData($data = []) {
  33. if (empty($data)) {
  34. return;
  35. }
  36. $this->setPkgName(get_val($data, 'pkg_name'));
  37. $this->setAppVer(get_val($data, 'app_ver'));
  38. $this->setHVer(get_val($data, 'h_ver', 0));
  39. $this->setSdkVer(get_val($data, 'sdk_ver'));
  40. $this->setHAppId(get_val($data, 'h_app_id', 0));
  41. $this->setMpId(get_val($data, 'mp_id', ''));
  42. $this->setVbId(get_val($data, 'vb_id', 0));
  43. }
  44. /**
  45. * @return string
  46. */
  47. public function getPkgName() {
  48. return $this->pkg_name;
  49. }
  50. /**
  51. * @param string $pkg_name
  52. */
  53. public function setPkgName($pkg_name) {
  54. $this->pkg_name = $pkg_name;
  55. }
  56. /**
  57. * @return string
  58. */
  59. public function getAppVer() {
  60. return $this->app_ver;
  61. }
  62. /**
  63. * @param string $app_ver
  64. */
  65. public function setAppVer($app_ver) {
  66. $this->app_ver = $app_ver;
  67. }
  68. /**
  69. * @return int
  70. */
  71. public function getHVer() {
  72. return $this->h_ver;
  73. }
  74. /**
  75. * @param int $h_ver
  76. */
  77. public function setHVer($h_ver) {
  78. $this->h_ver = $h_ver;
  79. }
  80. /**
  81. * @return string
  82. */
  83. public function getSdkVer() {
  84. return $this->sdk_ver;
  85. }
  86. /**
  87. * @param string $sdk_ver
  88. */
  89. public function setSdkVer($sdk_ver) {
  90. $this->sdk_ver = $sdk_ver;
  91. }
  92. /**
  93. * @return int
  94. */
  95. public function getHAppId() {
  96. return $this->h_app_id;
  97. }
  98. /**
  99. * @param int $h_app_id
  100. */
  101. public function setHAppId($h_app_id) {
  102. $this->h_app_id = $h_app_id;
  103. }
  104. /**
  105. * @return array
  106. */
  107. public function toArray() {
  108. $_data = [
  109. 'pkg_name' => $this->getPkgName(),
  110. 'app_ver' => $this->getAppVer(),
  111. 'h_ver' => $this->getHVer(),
  112. 'sdk_ver' => $this->getSdkVer(),
  113. 'app_id' => $this->getHAppId(),
  114. 'mp_id' => $this->getMpId(),
  115. 'vb_id' => $this->getVbId(),
  116. ];
  117. return $_data;
  118. }
  119. /**
  120. * @return string
  121. */
  122. public function getAppleId() {
  123. return $this->apple_id;
  124. }
  125. /**
  126. * @param string $apple_id
  127. */
  128. public function setAppleId($apple_id) {
  129. $this->apple_id = $apple_id;
  130. }
  131. /**
  132. * @return string
  133. */
  134. public function getMpId() {
  135. return $this->mp_id;
  136. }
  137. /**
  138. * @param string $mp_id
  139. */
  140. public function setMpId($mp_id) {
  141. $this->mp_id = $mp_id;
  142. }
  143. /**
  144. * @return string
  145. */
  146. public function getVbId() {
  147. return $this->vb_id;
  148. }
  149. /**
  150. * @param string $vb_id
  151. */
  152. public function setVbId($vb_id) {
  153. $this->vb_id = $vb_id;
  154. }
  155. }