The function moved from the user to the contact class
This commit is contained in:
parent
758eabd2f6
commit
7939cacc44
3 changed files with 19 additions and 16 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue