aboutsummaryrefslogtreecommitdiff
path: root/lib/filesystem/CourseTopicFolder.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2022-06-30 05:46:44 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2022-06-30 05:46:44 +0000
commit1284afc1159e665910c91ceb6a591a8511ed72de (patch)
tree80925fb7e022f631bb2703a5757392e5e39ab21f /lib/filesystem/CourseTopicFolder.php
parent46116209730837ab510865e917af65178e1f7593 (diff)
fix errors in filesystem, fixes #1231
Closes #1231 Merge request studip/studip!743
Diffstat (limited to 'lib/filesystem/CourseTopicFolder.php')
-rw-r--r--lib/filesystem/CourseTopicFolder.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/filesystem/CourseTopicFolder.php b/lib/filesystem/CourseTopicFolder.php
index f49ea88..3d35836 100644
--- a/lib/filesystem/CourseTopicFolder.php
+++ b/lib/filesystem/CourseTopicFolder.php
@@ -31,6 +31,7 @@ class CourseTopicFolder extends PermissionEnabledFolder implements FolderType
if ($course && !$course->isNew()) {
return Seminar_Perm::get()->have_studip_perm('tutor', $course->id, $user_id) && CourseTopic::countBySql("seminar_id = ?" , [$course->id]);
}
+ return false;
}
public function __construct($folderdata = null)
@@ -47,10 +48,7 @@ class CourseTopicFolder extends PermissionEnabledFolder implements FolderType
);
}
- /**
- * @return CourseTopic
- */
- public function getTopic()
+ public function getTopic(): ?CourseTopic
{
if (isset($this->folderdata['data_content']['topic_id'])) {
if ($this->topic === null) {
@@ -64,13 +62,15 @@ class CourseTopicFolder extends PermissionEnabledFolder implements FolderType
}
return $this->topic;
}
+
+ return null;
}
/**
* @param CourseTopic $topic
* @return CourseTopic
*/
- public function setTopic(CourseTopic $topic)
+ public function setTopic(CourseTopic $topic): ?CourseTopic
{
$this->topic = $topic;
$this->folderdata['data_content']['topic_id'] = $this->topic->id;