From b8b25e3b7bc8ae4900389a0bebee9240b3cba31b Mon Sep 17 00:00:00 2001 From: Martijn Date: Fri, 28 Apr 2017 13:23:51 +0200 Subject: [PATCH] Fixed an issue where only the last year would be returned --- code/service/EventList.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/service/EventList.php b/code/service/EventList.php index f8ec245..f3f82e6 100644 --- a/code/service/EventList.php +++ b/code/service/EventList.php @@ -58,6 +58,8 @@ public function generate() return false; } + /** @var ArrayList $years */ + $years = ArrayList::create([]); foreach ($list as $y => $months) { $year = ArrayData::create([ static::RESPONSE_YEAR => $y, @@ -73,8 +75,9 @@ public function generate() ]); $year->{static::RESPONSE_MONTHS}->push($group); } + $years->push($year); } - return $year; + return $years; } } \ No newline at end of file