]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Group.php
Fix docblocks types
[friendica.git] / src / Model / Group.php
index 542827151039e72bcf31a982c4083b52a8534259..410f78b1564216ffb2dbd1ecd599ffccb3970492 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Database\DBM;
 use dba;
 
 require_once 'boot.php';
+require_once 'include/dba.php';
 require_once 'include/text.php';
 
 /**
@@ -57,15 +58,12 @@ class Group extends BaseObject
        /**
         * @brief Get a list of group ids a contact belongs to
         *
-        * @todo Get rid of $uid, the contact id already bears the information
-        *
-        * @param int $uid
         * @param int $cid
         * @return array
         */
-       private static function getByContactIdForUserId($uid, $cid)
+       private static function getIdsByContactId($cid)
        {
-               $condition = ['uid' => $uid, 'contact-id' => $cid];
+               $condition = ['contact-id' => $cid];
                $stmt = dba::select('group_member', ['gid'], $condition);
 
                $return = [];
@@ -101,7 +99,6 @@ class Group extends BaseObject
                                FROM `group`
                                WHERE `group`.`uid` = ?;",
                        local_user(),
-                       local_user(),
                        local_user()
                );
 
@@ -134,7 +131,7 @@ class Group extends BaseObject
        /**
         * @brief Mark a group as deleted
         *
-        * @param type $gid
+        * @param int $gid
         * @return boolean
         */
        public static function remove($gid) {
@@ -179,9 +176,9 @@ class Group extends BaseObject
         *
         * @deprecated Use Group::remove instead
         *
-        * @param type $uid
-        * @param type $name
-        * @return type
+        * @param int $uid
+        * @param string $name
+        * @return bool
         */
        public static function removeByName($uid, $name) {
                $return = false;
@@ -369,7 +366,7 @@ class Group extends BaseObject
 
                $member_of = array();
                if ($cid) {
-                       $member_of = self::getByContactIdForUserId(local_user(), $cid);
+                       $member_of = self::getIdsByContactId($cid);
                }
 
                while ($group = dba::fetch($stmt)) {