Use exceptions for Notice::getByUri

..jeez, a long time since I commited. Three in a row to get this right. Sorry :)
This commit is contained in:
Mikael Nordfeldth 2014-01-12 22:46:50 +01:00
parent 08dba7e21d
commit edee39790e

View 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;
}
/**