* @version : HUOSDK 8.0 */ namespace huolib\queue\request; class Game extends Request { private $pkg_name = ''; /* 游戏包名 */ private $app_ver = ''; /* 游戏版本 */ private $h_ver = 0; /* 聚合SDK版本编号 */ private $sdk_ver = ''; /* 客户端渠道SDK版本编号 */ private $h_app_id = 0; /* 游戏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)); } /** * 变量转数组 * * @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(), ]; return $_data; } /** * 校验参数合法性 */ public function check() { // TODO: wuyonghong 2018/5/30 校验游戏参数合法性 return true; } /** * @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; } }