1
1
Fork 0

The function moved from the user to the contact class

This commit is contained in:
Michael 2019-02-10 17:19:10 +00:00
commit 7939cacc44
3 changed files with 19 additions and 16 deletions

View file

@ -155,6 +155,23 @@ class Contact extends BaseObject
return PortableContact::detectServer($url);
}
/**
* Returns the public contact id of the given user id
*
* @param integer $uid User ID
*
* @return integer|boolean Public contact id for given user id
* @throws Exception
*/
public static function getPublicIdByUserId($uid)
{
$self = DBA::selectFirst('contact', ['url'], ['self' => true, 'uid' => $uid]);
if (!DBA::isResult($self)) {
return false;
}
return self::getIdForURL($self['url'], 0, true);
}
/**
* @brief Returns the contact id for the user and the public contact id for a given contact id
*