Remove lingering reference to group_member.uid

This commit is contained in:
Hypolite Petovan 2017-12-16 11:50:58 -05:00
parent dc7bff0235
commit 0dbf7a2611
1 changed files with 3 additions and 6 deletions

View File

@ -57,15 +57,12 @@ class Group extends BaseObject
/** /**
* @brief Get a list of group ids a contact belongs to * @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 * @param int $cid
* @return array * @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); $stmt = dba::select('group_member', ['gid'], $condition);
$return = []; $return = [];
@ -369,7 +366,7 @@ class Group extends BaseObject
$member_of = array(); $member_of = array();
if ($cid) { if ($cid) {
$member_of = self::getByContactIdForUserId(local_user(), $cid); $member_of = self::getIdsByContactId($cid);
} }
while ($group = dba::fetch($stmt)) { while ($group = dba::fetch($stmt)) {