Пример #1
0
 public function gamedata($playerID = null, $return = false)
 {
     Validate::player($playerID);
     //we are going to pass all data's
     $array = array();
     //this is what we store the data in.
     $player = new PlayerModel();
     $level = new LevelModel();
     $playerLevel = new PlayerLevelModel($playerID);
     $store = new StoreModel();
     $abModel = new ABModel();
     $rankModel = new RankModel();
     $array['status'] = 'ok';
     $array['player'] = $player->getPlayerData(array($playerID, false));
     $array['featuretests'] = $abModel->getTests($playerID);
     $array['scores'] = $playerLevel->load($playerID);
     $array['stores'] = $store->getStores();
     $array['gifts'] = $player->getGifts($playerID);
     $array['liferequests'] = $player->getRequests($playerID);
     $array['levels'] = $level->getLevelData();
     $array['ranks'] = $rankModel->getRanks();
     $levelData = null;
     $tmpObject = null;
     if ($return) {
         return $array;
     } else {
         $this->printJson($array);
     }
 }