From: Mikael Nordfeldth Date: Sun, 12 Jan 2014 21:46:50 +0000 (+0100) Subject: Use exceptions for Notice::getByUri X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=edee39790e6b125e01049e82a54a765de492a85a;p=quix0rs-gnu-social.git Use exceptions for Notice::getByUri ..jeez, a long time since I commited. Three in a row to get this right. Sorry :) --- diff --git a/classes/Notice.php b/classes/Notice.php index a1750dda4d..6ed4b34afa 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -218,7 +218,12 @@ class Notice extends Managed_DataObject public static function getByUri($uri) { - return static::getKV('uri', $uri); + $notice = new Notice(); + $notice->uri = $uri; + if (!$notice->find(true)) { + throw new NoResultException($notice); + } + return $notice; } /**