From edee39790e6b125e01049e82a54a765de492a85a Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 12 Jan 2014 22:46:50 +0100 Subject: [PATCH] Use exceptions for Notice::getByUri ..jeez, a long time since I commited. Three in a row to get this right. Sorry :) --- classes/Notice.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } /** -- 2.39.5