From: Mikael Nordfeldth Date: Thu, 9 Jul 2015 22:08:09 +0000 (+0200) Subject: Need to supply data to NoSuchUserException X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8cc85f684b7615009f4e29963a2d32b08293dee2;p=quix0rs-gnu-social.git Need to supply data to NoSuchUserException --- diff --git a/classes/User.php b/classes/User.php index 3efaa5e721..9ae0cba804 100644 --- a/classes/User.php +++ b/classes/User.php @@ -142,6 +142,16 @@ class User extends Managed_DataObject return $this->getProfile()->getNickname(); } + public function getByNickname($nickname) + { + $user = User::getKV('nickname', $nickname); + if (!$user instanceof User) { + throw new NoSuchUserException(array('nickname' => $nickname)); + } + + return $user; + } + function isSubscribed(Profile $other) { return $this->getProfile()->isSubscribed($other); @@ -439,7 +449,7 @@ class User extends Managed_DataObject function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) { - return Reply::stream($this->id, $offset, $limit, $since_id, $before_id); + return $this->getProfile()->getReplies($offset, $limit, $since_id, $before_id); } function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) {