Notice class got exception throwing getById
Less code, more happy.
This commit is contained in:
parent
f321c3c2ea
commit
aa27c45230
@ -313,6 +313,16 @@ class Notice extends Managed_DataObject
|
||||
return $notice;
|
||||
}
|
||||
|
||||
public static function getById($id)
|
||||
{
|
||||
$notice = new Notice();
|
||||
$notice->id = $id;
|
||||
if (!$notice->find(true)) {
|
||||
throw new NoResultException($notice);
|
||||
}
|
||||
return $notice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract #hashtags from this notice's content and save them to the database.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user