]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
Replace System::httpExit() by HTTPException throwing
[friendica.git] / src / Model / User.php
index 4b3823f040d0e1db8f1f7dca070274bee68667fa..c575b44d38ea222593a6b20896fec42ee6d2753d 100644 (file)
@@ -91,12 +91,24 @@ class User
 
        /**
         * @param  integer       $uid
+        * @param array          $fields
         * @return array|boolean User record if it exists, false otherwise
         * @throws Exception
         */
-       public static function getById($uid)
+       public static function getById($uid, array $fields = [])
        {
-               return DBA::selectFirst('user', [], ['uid' => $uid]);
+               return DBA::selectFirst('user', $fields, ['uid' => $uid]);
+       }
+
+       /**
+        * @param  string        $nickname
+        * @param array          $fields
+        * @return array|boolean User record if it exists, false otherwise
+        * @throws Exception
+        */
+       public static function getByNickname($nickname, array $fields = [])
+       {
+               return DBA::selectFirst('user', $fields, ['nickname' => $nickname]);
        }
 
        /**