MDL-65658 mod_forum: Group images links and titles groups
[moodle.git] / mod / forum / classes / local / factories / url.php
index ab0fc75..cfb6b4b 100644 (file)
@@ -427,6 +427,18 @@ class url {
         return $userpicture->get_url($PAGE);
     }
 
+    /**
+     * Get the url to view an author's group.
+     *
+     * @param \stdClass $group The group
+     * @return moodle_url
+     */
+    public function get_author_group_url(\stdClass $group) : moodle_url {
+        return new moodle_url('/user/index.php', [
+                'id' => $group->courseid,
+                'group' => $group->id
+        ]);
+    }
     /**
      * Get the url to mark a discussion as read.
      *