Exemple #1
0
 public function create($playerID)
 {
     Log::add('made it to incentive create');
     Validate::player($playerID);
     $hash = filter_input(INPUT_POST, "key");
     $type = filter_input(INPUT_POST, "incType");
     //for this to work, there has to be a player record with the last sessionID == hash
     $incentiveModel = new IncentiveModel();
     if ($incentiveModel->create($hash, $playerID, $type)) {
         $this->printJson(array('status' => 'ok', 'key' => $hash));
     } else {
         $this->printJson(array('status' => 'error'));
     }
 }