123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- <?php
- namespace huo\controller\request;
- class Role {
- private $event = 0;
- private $server_id = '';
- private $server_name = '';
- private $role_id = '';
- private $role_name = '';
- private $role_level = 0;
- private $role_vip = 0;
- private $combat_num = 0;
- private $onlineTime = 0;
- private $scene = '';
- private $axis = '';
- private $last_operation = '';
- private $experience = '';
- private $party_name = '';
- private $role_balance = '';
- private $attach = '';
- private $rolelevel_ctime = '';
- private $rolelevel_mtime = '';
- private $last_login_time = 0;
- public function __construct($data = []) {
- if (!empty($data)) {
- $this->setData($data);
- }
- }
-
- public function setData($data = []) {
- if (empty($data)) {
- return;
- }
- $this->setEvent(get_val($data, 'event', 0));
- $this->setServerId(get_val($data, 'server_id'));
- $this->setServerName(get_val($data, 'server_name'));
- $this->setRoleId(get_val($data, 'role_id'));
- $this->setRoleName(get_val($data, 'role_name'));
- $this->setRoleLevel(get_val($data, 'role_level', 0));
- $this->setRoleVip(get_val($data, 'role_vip', 0));
- $this->setCombatNum(get_val($data, 'combat_num', 0));
- $this->setLastLoginTime(get_val($data, 'list_login_time', 0));
- $this->setOnlineTime(get_val($data, 'onlineTime', 0));
- $this->setScene(get_val($data, 'scene'));
- $this->setAxis(get_val($data, 'axis'));
- $this->setLastOperation(get_val($data, 'last_operation'));
- $this->setExperience(get_val($data, 'last_operation', 0));
- $this->setPartyName(get_val($data, 'party_name', 0));
- $this->setRoleBalance(get_val($data, 'role_balance', 0));
- $this->setAttach(get_val($data, 'attach', 0));
- $this->setRolelevelCtime(get_val($data, 'rolelevel_ctime', 0));
- $this->setRolelevelMtime(get_val($data, 'rolelevel_mtime', 0));
- }
-
- public function getEvent() {
- return $this->event;
- }
-
- public function setEvent($event) {
- if (is_numeric($event)) {
- $this->event = $event;
- } else {
- switch ($event) {
- case 'online':
-
- $this->event = 1;
- break;
- case 'create':
-
- $this->event = 2;
- break;
- case 'levelup':
-
- $this->event = 3;
- break;
- case 'offline':
-
- $this->event = 4;
- break;
- case 'delete':
-
- $this->event = 6;
- break;
- default:
-
- $this->event = 5;
- }
- }
- }
-
- public function getServerId() {
- return $this->server_id;
- }
-
- public function setServerId($server_id) {
- $this->server_id = $server_id;
- }
-
- public function getServerName() {
- return $this->server_name;
- }
-
- public function setServerName($server_name) {
- $this->server_name = $server_name;
- }
-
- public function getRoleId() {
- return $this->role_id;
- }
-
- public function setRoleId($role_id) {
- $this->role_id = $role_id;
- }
-
- public function getRoleName() {
- return $this->role_name;
- }
-
- public function setRoleName($role_name) {
- $this->role_name = $role_name;
- }
-
- public function getRoleLevel() {
- return $this->role_level;
- }
-
- public function setRoleLevel($role_level) {
- $this->role_level = $role_level;
- }
-
- public function getRoleVip() {
- return $this->role_vip;
- }
-
- public function setRoleVip($role_vip) {
- $this->role_vip = $role_vip;
- }
-
- public function getCombatNum() {
- return $this->combat_num;
- }
-
- public function setCombatNum($combat_num) {
- $this->combat_num = $combat_num;
- }
-
- public function getLastLoginTime() {
- return $this->last_login_time;
- }
-
- public function setLastLoginTime($last_login_time) {
- $this->last_login_time = $last_login_time;
- }
-
- public function getOnlineTime() {
- return $this->onlineTime;
- }
-
- public function setOnlineTime($onlineTime) {
- $this->onlineTime = $onlineTime;
- }
-
- public function getScene() {
- return $this->scene;
- }
-
- public function setScene($scene) {
- $this->scene = $scene;
- }
-
- public function getAxis() {
- return $this->axis;
- }
-
- public function setAxis($axis) {
- $this->axis = $axis;
- }
-
- public function getLastOperation() {
- return $this->last_operation;
- }
-
- public function setLastOperation($last_operation) {
- $this->last_operation = $last_operation;
- }
-
- public function getExperience() {
- return $this->experience;
- }
-
- public function setExperience($experience) {
- $this->experience = $experience;
- }
-
- public function getPartyName() {
- return $this->party_name;
- }
-
- public function setPartyName($party_name) {
- $this->party_name = $party_name;
- }
-
- public function getRoleBalance() {
- return $this->role_balance;
- }
-
- public function setRoleBalance($role_balance) {
- $this->role_balance = $role_balance;
- }
-
- public function getAttach() {
- return $this->attach;
- }
-
- public function setAttach($attach) {
- $this->attach = $attach;
- }
-
- public function getRolelevelCtime() {
- return $this->rolelevel_ctime;
- }
-
- public function setRolelevelCtime($rolelevel_ctime) {
- $this->rolelevel_ctime = $rolelevel_ctime;
- }
-
- public function getRolelevelMtime() {
- return $this->rolelevel_mtime;
- }
-
- public function setRolelevelMtime($rolelevel_mtime) {
- $this->rolelevel_mtime = $rolelevel_mtime;
- }
- public function toArray() {
- $_data['server_id'] = $this->getServerId();
- $_data['server_name'] = $this->getServerName();
- $_data['role_id'] = $this->getRoleId();
- $_data['role_name'] = $this->getRoleName();
- $_data['role_level'] = $this->getRoleLevel();
- $_data['role_vip'] = $this->getRoleVip();
- $_data['online_time'] = $this->getOnlineTime();
- $_data['scene'] = $this->getScene();
- $_data['axis'] = $this->getAxis();
- $_data['last_operation'] = $this->getLastOperation();
- $_data['type'] = $this->getEvent();
- $_data['last_operation'] = $this->getExperience();
- $_data['party_name'] = $this->getPartyName();
- $_data['role_balance'] = $this->getRoleBalance();
- $_data['attach'] = $this->getAttach();
- $_data['rolelevel_ctime'] = $this->getRolelevelCtime();
- $_data['rolelevel_mtime'] = $this->getRolelevelMtime();
- return $_data;
- }
- }
|