* @version : HUOSDK 8.0 */ namespace huo\controller\request; class Game { private $pkg_name = ''; /* 游戏包名 */ private $app_ver = ''; /* 游戏版本 */ private $h_ver = 0; /* 聚合SDK版本编号 */ private $sdk_ver = ''; /* 客户端渠道SDK版本编号 */ private $h_app_id = 0; /* 游戏ID */ private $apple_id = '';/* 苹果ID */ private $mp_id = '';/* 小程序ID */ private $vb_id = '';/* 马甲包ID */ public function __construct($data = []) { if (!empty($data)) { $this->setData($data); } } /** * 设置数据 * * @param array $data */ public function setData($data = []) { if (empty($data)) { return; } $this->setPkgName(get_val($data, 'pkg_name')); $this->setAppVer(get_val($data, 'app_ver')); $this->setHVer(get_val($data, 'h_ver', 0)); $this->setSdkVer(get_val($data, 'sdk_ver')); $this->setHAppId(get_val($data, 'h_app_id', 0)); $this->setMpId(get_val($data, 'mp_id', '')); $this->setVbId(get_val($data, 'vb_id', 0)); } /** * @return string */ public function getPkgName() { return $this->pkg_name; } /** * @param string $pkg_name */ public function setPkgName($pkg_name) { $this->pkg_name = $pkg_name; } /** * @return string */ public function getAppVer() { return $this->app_ver; } /** * @param string $app_ver */ public function setAppVer($app_ver) { $this->app_ver = $app_ver; } /** * @return int */ public function getHVer() { return $this->h_ver; } /** * @param int $h_ver */ public function setHVer($h_ver) { $this->h_ver = $h_ver; } /** * @return string */ public function getSdkVer() { return $this->sdk_ver; } /** * @param string $sdk_ver */ public function setSdkVer($sdk_ver) { $this->sdk_ver = $sdk_ver; } /** * @return int */ public function getHAppId() { return $this->h_app_id; } /** * @param int $h_app_id */ public function setHAppId($h_app_id) { $this->h_app_id = $h_app_id; } /** * @return array */ public function toArray() { $_data = [ 'pkg_name' => $this->getPkgName(), 'app_ver' => $this->getAppVer(), 'h_ver' => $this->getHVer(), 'sdk_ver' => $this->getSdkVer(), 'app_id' => $this->getHAppId(), 'mp_id' => $this->getMpId(), 'vb_id' => $this->getVbId(), ]; return $_data; } /** * @return string */ public function getAppleId() { return $this->apple_id; } /** * @param string $apple_id */ public function setAppleId($apple_id) { $this->apple_id = $apple_id; } /** * @return string */ public function getMpId() { return $this->mp_id; } /** * @param string $mp_id */ public function setMpId($mp_id) { $this->mp_id = $mp_id; } /** * @return string */ public function getVbId() { return $this->vb_id; } /** * @param string $vb_id */ public function setVbId($vb_id) { $this->vb_id = $vb_id; } }