summaryrefslogtreecommitdiff
path: root/app/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'app/Libraries')
-rw-r--r--app/Libraries/AnimeSeason.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/app/Libraries/AnimeSeason.php b/app/Libraries/AnimeSeason.php
index a234d5c..acdb34f 100644
--- a/app/Libraries/AnimeSeason.php
+++ b/app/Libraries/AnimeSeason.php
@@ -3,7 +3,7 @@
namespace App\Libraries;
use App\Libraries\AnimeSeason;
use App\Anime;
-use App\AnimeScore;
+use App\AnimeStats;
use Carbon\Carbon;
@@ -27,16 +27,26 @@ class AnimeSeason {
);
$this->year = $season->seasonYear;
- $this->name= $season->seasonName;
+ $this->name = $season->seasonName;
$count = 0;
foreach($season->anime as $entry) {
$count++;
- $anime = new AnimeScore( $entry->getMalID() );
- $this->anime[] = $anime;
+
+ $anime = new Anime( $entry->getMalID() );
$anime->save();
- if ( $count == 5) {
+ $animeStats = new AnimeStats( $entry->getMalID(), $this->year, $this->name );
+ $this->anime[] = $animeStats;
+
+ $animeStats->create();
+
+ /*
+ echo "<pre>";
+ var_dump($anime);
+ */
+
+ if ( $count == 1) {
return;
}
}