Closed n4ndo closed 8 years ago
If you want the league information to be stored in the summoner object, you need to pass the summoner object to league(), and not only it's Id.
On Wed, Mar 9, 2016, 9:20 PM Nano notifications@github.com wrote:
Hello,
im trying to get the leagues result from a search in this way:
//echo $summoner->id; // Gives ID From summoner - Works $api->league(); // Init the League Object $league = $api->league()->league($summoner->id); $leagueSummoner = $summoner->league($summoner->name)->entry($summoner->id);
I have this result:
Fatal error: Call to a member function entry() on null in D:\xampp\htdocs\app\controllers\GameController.php on line 165
Any idea what im doing wrong?
Thanks.
— Reply to this email directly or view it on GitHub https://github.com/paquettg/leaguewrap/issues/108.
Hello @danijoo thanks for your answer.
Im just trying to replicate: https://github.com/paquettg/leaguewrap/blob/master/tests/Api/LeagueTest.php#L87
Does it work now?
On Thu, Mar 10, 2016, 4:48 AM Nano notifications@github.com wrote:
Hello @danijoo https://github.com/danijoo thanks for your answer.
Im just trying to replicate: https://github.com/paquettg/leaguewrap/blob/master/tests/Api/LeagueTest.php#L87
— Reply to this email directly or view it on GitHub https://github.com/paquettg/leaguewrap/issues/108#issuecomment-194649868 .
Hello @danijoo, no, this is a little bit weird, this is part of an old test-project code, that was working, just updated to leaguewrap master and somethings broke after.
the original code is:
$region = "";
$summonerName = $this->disinfect->xss_clean(trim(strtolower("")));
$api = $this->leagueStart;
$api->setRegion($region);
$api->summoner();
$summoner = $api->summoner()->info($summonerName); // Get the Profile information about this user.
$teamSummoner = $api->team()->team($summoner->id); // Teams
$api->league(); // Init the League Object
$api->league($summoner); // Get the leagues Information about this user
$league = $api->league()->league($summoner->id);
$leagueSummoner = $summoner->league($summoner->name)->entry($summoner->id);
the before code was working.
Cordially
Same issue as above. You are still passing a summoner Id to league and not the summoner object.
On Thu, Mar 10, 2016, 6:01 PM Nano notifications@github.com wrote:
no, this is a little bit weird, this is part of an old test-project code, that was working, just update to leaguewrap master and somethings broke after.
the original code is:
$region = ""; $summonerName = $this->disinfect->xss_clean(trim(strtolower(""))); $api = $this->leagueStart; $api->setRegion($region); $api->summoner(); $summoner = $api->summoner()->info($summonerName); // Get the Profile information about this user. $teamSummoner = $api->team()->team($summoner->id); // Teams $api->league(); // Init the League Object $api->league($summoner); // Get the leagues Information about this user $league = $api->league()->league($summoner->id); $leagueSummoner = $summoner->league($summoner->name)->entry($summoner->id);
—
Reply to this email directly or view it on GitHub https://github.com/paquettg/leaguewrap/issues/108#issuecomment-194956393 .
I dont see where your problem is. just pass the summoner...
$league = $api->league()->league($summoner);
thank you very much for your help and time, just returning to code on PHP...
$api->summoner();
$summoner = $api->summoner()->info($summonerName); // Get the Profile information about this user.
$api->league(); // Init the League Object
$league = $api->league()->league($summoner); // Works if i print_r give all entries.
$leagueSummoner = $summoner->league($summoner->name)->entry($summoner->id);
Works
Hello,
im trying to get the leagues result from a search in this way:
I have this result:
Any idea what im doing wrong?
Thanks.