X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FGroup.php;h=410f78b1564216ffb2dbd1ecd599ffccb3970492;hb=916236ce2fe2c0e9e48d000c6d665f96fecf00a9;hp=542827151039e72bcf31a982c4083b52a8534259;hpb=a3ea106662efc30ce1345ed5005383f3c198f73a;p=friendica.git diff --git a/src/Model/Group.php b/src/Model/Group.php index 5428271510..410f78b156 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -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)) {