improve Profile model

This commit is contained in:
Philipp Holzer 2019-07-27 23:56:54 +02:00
parent 46211de037
commit 7613704d2f
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90

View File

@ -55,12 +55,12 @@ class Profile
* @return array Array of profile data * @return array Array of profile data
* @throws \Exception * @throws \Exception
*/ */
public static function get(int $uid, int $id = null, array $fields = []) public static function select(int $uid, int $id = null, array $fields = [])
{ {
if (empty($id)) { if (empty($id)) {
return DBA::select('profile', $fields, ['uid' => $uid]); return DBA::selectToArray('profile', $fields, ['uid' => $uid]);
} else { } else {
return DBA::select('profile', $fields, ['uid' => $uid, 'id' => $id]); return DBA::selectFirst('profile', $fields, ['uid' => $uid, 'id' => $id]);
} }
} }