]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
[quix0rs-gnu-social.git] / classes / User.php
index be362e67fa9042d392aa805e73e1e7c1e17f07cc..328e5be3e12417763f954da8ad4d89209cb2fa13 100644 (file)
@@ -68,6 +68,9 @@ class User extends Memcached_DataObject
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
+    /**
+     * @return Profile
+     */
     function getProfile()
     {
         $profile = Profile::staticGet('id', $this->id);
@@ -596,6 +599,30 @@ class User extends Memcached_DataObject
         return $profile->getGroups($offset, $limit);
     }
 
+    /**
+     * Request to join the given group.
+     * May throw exceptions on failure.
+     *
+     * @param User_group $group
+     * @return Group_member
+     */
+    function joinGroup(User_group $group)
+    {
+        $profile = $this->getProfile();
+        return $profile->joinGroup($group);
+    }
+
+    /**
+     * Leave a group that this user is a member of.
+     *
+     * @param User_group $group
+     */
+    function leaveGroup(User_group $group)
+    {
+        $profile = $this->getProfile();
+        return $profile->leaveGroup($group);
+    }
+
     function getSubscriptions($offset=0, $limit=null)
     {
         $profile = $this->getProfile();