paquettg / leaguewrap

League of Legend API wrapper
MIT License
68 stars 28 forks source link

Unable to return ALL createDate from Recent Object? #93

Closed savisaar2 closed 8 years ago

savisaar2 commented 8 years ago

This is what i am doing:

try { $games = $node2->recent($loluser); if ($games) { foreach ($games as $game) { $result = $database->insert("matches", array( "match_id" => $game->gameId, "champion" => $game->championId, "win" => $game->stats->win, "kda" => $game->stats->championsKilled."/".$game->stats->numDeaths."/".$game->stats->assists, "spell1" => $game->spell1, "spell2" => $game->spell2, "item0" => $game->stats->item0, "item1" => $game->stats->item1, "item2" => $game->stats->item2, "item3" => $game->stats->item3, "item4" => $game->stats->item4, "item5" => $game->stats->item5, "order_id" => $order_id, "gold" => $game->stats->goldEarned, "minions_killed" => $game->stats->minionsKilled, "datecreated" => $game->createDate )); } } } catch(Exception $e) { echo "Matches Not Retrieved!"; }

problem is that every game updates each field correctly apart from datecreated field which is all the same INT which doesnt exist in the actual object?

How can i correctly retrieve createDate? from $api->game();

savisaar2 commented 8 years ago

Issue was relating to that fact that i wasnt storing the variable in a larger int field. Changing INT to BigINT solved the issue.