Fix getByIdAndRssToken function

This commit is contained in:
DariusIII
2018-02-02 11:25:43 +01:00
parent 73432fe3d9
commit 54b26cfd70
2 changed files with 3 additions and 18 deletions
+1
View File
@@ -1,4 +1,5 @@
2018-02-02 DariusIII
* Fix: Fix getByIdAndRssToken function
* Chg: Use replace getById user lookup with User model find built in function(does the same thing as custom function)
2018-02-01 DariusIII
* Chg: Update sebastian/comparator to latest version
+2 -18
View File
@@ -529,28 +529,12 @@ class User extends Authenticatable
*/
public static function getByIdAndRssToken($userID, $rssToken)
{
$user = self::query()->where('id', '=', $userID, true)->where('rsstoken', '=', $rssToken)->get();
$user = self::query()->where(['id' => $userID, 'rsstoken' => $rssToken])->first();
if ($user === null) {
return false;
}
return $user;
}
/**
* @param $id
*
* @return array|bool
*/
public static function getById($id)
{
$result = self::find($id);
if ($result === null) {
return false;
}
return $result;
return $user->toArray();
}
/**