mirror of
https://github.com/friendica/friendica
synced 2025-04-25 04:30:11 +00:00
Replace q() call with Profile::get() method
This commit is contained in:
parent
6c2cf494b5
commit
2a87464c97
2 changed files with 52 additions and 38 deletions
|
@ -45,6 +45,25 @@ class Profile
|
|||
return $profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the profile based on a ID
|
||||
*
|
||||
* @param int $uid The User ID
|
||||
* @param int $id The id of the profile (optional)
|
||||
* @param array $fields The fields to retrieve
|
||||
*
|
||||
* @return array Array of profile data
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function get(int $uid, int $id = null, array $fields = [])
|
||||
{
|
||||
if (empty($id)) {
|
||||
return DBA::select('profile', $fields, ['uid' => $uid]);
|
||||
} else {
|
||||
return DBA::select('profile', $fields, ['uid' => $uid, 'id' => $id]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a formatted location string from the given profile array
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue