mal_id = $id; parent::__construct($this->mal_id); $jikan = new Malclient; # if ( 0 == $season_year || "" == $season_name ) { $season = $jikan->getSeasonal( (new \Jikan\Request\Seasonal\SeasonalRequest( )) ); $this->season_year = $season->seasonYear; $this->season_name= $season->seasonName; /* } else { $this->season_year = $season_year; $this->season_name= $season_name; } */ $animeInfo = $this->getInfo(); $this->score = $animeInfo->getScore(); $this->scored_by = $animeInfo->getScoredBy(); $this->rank = $animeInfo->getRank(); $this->popularity = $animeInfo->getPopularity(); $this->members = $animeInfo->getMembers(); $this->favorites = $animeInfo->getFavorites(); $animeStats = $jikan->getAnimeStats( (new \Jikan\Request\Anime\AnimeStatsRequest( $this->mal_id )) ); $this->watching = $animeStats->getWatching(); $this->completed = $animeStats->getCompleted(); $this->onhold = $animeStats->getOnHold(); $this->dropped = $animeStats->getDropped(); $this->plan_to_watch = $animeStats->getPlanToWatch(); $scores = $animeStats->getScores(); $this->score_1 = $scores[1]->getVotes(); $this->score_2 = $scores[2]->getVotes(); $this->score_3 = $scores[3]->getVotes(); $this->score_4 = $scores[4]->getVotes(); $this->score_5 = $scores[5]->getVotes(); $this->score_6 = $scores[6]->getVotes(); $this->score_7 = $scores[7]->getVotes(); $this->score_8 = $scores[8]->getVotes(); $this->score_9 = $scores[9]->getVotes(); $this->score_10 = $scores[10]->getVotes(); } }