Replace q() call with Profile::get() method
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user