diff options
| author | Rasmus Fuhse <fuhse@data-quest.de> | 2022-03-31 14:17:41 +0000 |
|---|---|---|
| committer | André Noack <noack@data-quest.de> | 2022-03-31 14:17:41 +0000 |
| commit | b7802baa589843f44f5cbed5a04dd522bd54daa0 (patch) | |
| tree | 5129c94b428c3b1dbf9aaccc12b64e38b3d6bff7 /lib/models/Semester.class.php | |
| parent | 8073d9c7cb2e8e187cbfb776b865ec9ba2623c25 (diff) | |
Resolve "Unbegrenzte Veranstaltungen haben Startzeitpunkt!"
Diffstat (limited to 'lib/models/Semester.class.php')
| -rw-r--r-- | lib/models/Semester.class.php | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/models/Semester.class.php b/lib/models/Semester.class.php index b2b7f31..2652de8 100644 --- a/lib/models/Semester.class.php +++ b/lib/models/Semester.class.php @@ -349,23 +349,15 @@ class Semester extends SimpleORMap /** * Returns the start week dates for this semester (and other - * semesters if duration is > 0). + * semesters if $end_semester is given). * - * @param mixed $duration Duration time (false to restrict to current - * semester, -1 for indefinite duration, otherwise - * the int value for the duration so that - * semester start + duration = end) + * @param Semester $end_semester end semester, default is $this * @return array containing the start weeks */ - public function getStartWeeks($duration = false) + public function getStartWeeks(?Semester $end_semester = null) { - if ($duration === false) { + if (!$end_semester) { $end_semester = $this; - } elseif ($duration == -1) { - $semesters = self::getAll(); - $end_semester = end($semesters); - } else { - $end_semester = self::findByTimestamp((int)$this->beginn + (int)$duration); } $timestamp = $this->getCorrectedLectureBegin(); |
