]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use exceptions for Notice::getByUri
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 12 Jan 2014 21:46:50 +0000 (22:46 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 12 Jan 2014 21:46:50 +0000 (22:46 +0100)
..jeez, a long time since I commited. Three in a row to get this right. Sorry :)

classes/Notice.php

index a1750dda4dd22b915acf9fbaad39849ee386c800..6ed4b34afa9c2e7588346147f893a26836528b40 100644 (file)
@@ -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;
     }
 
     /**