mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
Move mod/allfriends to src/Module/AllFriends
This commit is contained in:
parent
2628da422a
commit
c5e7abf9c5
5 changed files with 198 additions and 179 deletions
|
@ -237,6 +237,28 @@ class Contact extends BaseObject
|
|||
return ['public' => $pcid, 'user' => $ucid];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns contact details for a given contact id in combination with a user id
|
||||
*
|
||||
* @param int $cid A contact ID
|
||||
* @param int $uid The User ID
|
||||
* @param array $fields The selected fields for the contact
|
||||
*
|
||||
* @return array The contact details
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getContactForUser($cid, $uid, array $fields = [])
|
||||
{
|
||||
$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => $uid]);
|
||||
|
||||
if (!DBA::isResult($contact)) {
|
||||
return [];
|
||||
} else {
|
||||
return $contact;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Block contact id for user id
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue