- $return = DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $cid]);
-
- return $return;
- }
-
- /**
- * Removes a contact from a group based on its name
- *
- * @param int $uid
- * @param string $name
- * @param int $cid
- * @return boolean
- * @throws \Exception
- * @deprecated Use Group::removeMember instead
- *
- */
- public static function removeMemberByName($uid, $name, $cid)
- {
- $gid = self::getIdByName($uid, $name);
+ // @TODO Backward compatibility with user contacts, remove by version 2022.03
+ $group = DBA::selectFirst('group', ['uid'], ['id' => $gid]);
+ if (empty($group)) {
+ throw new HTTPException\NotFoundException('Group not found.');
+ }