]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Notice class got exception throwing getById
[quix0rs-gnu-social.git] / classes / Notice.php
index c631c1fcc6768dd690bb449c8115096c1806f644..61b18a8710a3f44f1bc413db414bcb0503d2cf51 100644 (file)
@@ -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.
      */