| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 | <?php/** * Game.php UTF-8 * 游戏请求参数 * * @date    : 2018/1/19 15:21 * * @license 这不是一个自由软件,未经授权不许任何使用和传播。 * @author  : wuyonghong <wyh@huosdk.com> * @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;    }}
 |